The first usage:
In MVC, you can still use the Ajax checksum, as in WebForm, the only difference is to change the previous URL path to the behavior of the access controller.
Front desk In fact, MVC has already made a better encapsulation of JSON, in terms of background code, you can return to Jsonresult, so you can dispense with your own handwriting JavaScriptSerializer class
Second usage:
The AJAX checksum has been well encapsulated in MVC and can be directly point out using the associated class library.
Ajax.beginform (...)
First, because even if Microsoft's MVC is encapsulated, it still relies on Ajax, so it needs to add the corresponding J file
<script src= "~/scripts/jquery-1.8.2.min.js" ></script>
<script src= "~/scripts/jquery.unobtrusive-ajax.min.js" ></script>
The above code implements an asynchronous commit operation, Of course, Ajax.beginform has a lot of overloads, can achieve basic all the handwriting function, but also found that the type of the Submit button is a submit type, but still is the process of asynchronous invocation, the specific reason is that the implicit JS file, the first will find the tagged form form, and then the data in the form into Not be affected by the subsequent commit button.
The Ajax asynchronous submission form of MVC