Using Ajax.BeginForm with ASP.NET MVC 3 Razor

后端 未结 8 1012
面向向阳花
面向向阳花 2020-11-22 01:23

Is there a tutorial or code example of using Ajax.BeginForm within Asp.net MVC 3 where unobtrusive validation and Ajax exist?

This is an elusive topic f

8条回答
  •  灰色年华
    2020-11-22 01:39

    Ajax forms work asynchronously using Javascript. So it is required, to load the script files for execution. Even though it's a small performance compromise, the execution happens without postback.

    We need to understand the difference between the behaviours of both Html and Ajax forms.

    Ajax:

    1. Won't redirect the form, even you do a RedirectAction().

    2. Will perform save, update and any modification operations asynchronously.

    Html:

    1. Will redirect the form.

    2. Will perform operations both Synchronously and Asynchronously (With some extra code and care).

    Demonstrated the differences with a POC in below link. Link

提交回复
热议问题