what is the difference between Html.BeginForm
() and Ajax.Beginform
() in MVC3. I just want to know the scenarios where I can use Html.BeginFor
Html.BeginForm() will create a form on the page that submits its values to the server as a synchronous HTTP request, refreshing the entire page in the process.
Ajax.BeginForm() creates a form that submits its values using an asynchronous ajax request. This allows a portion of the page to be update without requiring that the entire page be refreshed.
Html.BeginForm()
will use simple posting on page, it means your page will be refreshed when you post your form.
when Ajax.BeginForm()
will use ajax posting on page, it means your page will not be refreshed when you post your form.
Ajax
RedirectAction()
.FormMethods - OnSubmit
. So you are abort the Post
Html
Synchronously
and Asynchronously
(With some extra code and care).