Html.BeginForm()和ajax.beginform之间的差异() [英] difference between Html.BeginForm() and ajax.beginform()

查看:311
本文介绍了Html.BeginForm()和ajax.beginform之间的差异()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Html.BeginForm Ajax.Beginform ()在MVC3的差异()。我只是想知道我在哪里可以使用场景 Html.BeginForm (),并在那里我可以用 Ajax.Beginform ()

what is the difference between Html.BeginForm() and Ajax.Beginform() in MVC3. I just want to know the scenarios where I can use Html.BeginForm() and where I can use Ajax.Beginform().

推荐答案

阿贾克斯


  1. 不会重定向形状即使你做了 RedirectAction()

  2. 将执行保存,更新和任何修改操作异步。

  3. 验证使用 FormMethods的形式 - 的OnSubmit 。那么,你是中止发表

  4. 这将创建一个使用异步Ajax请求提交其价值的一种形式。这允许页面的一部分被更新,而不需要整个页面被刷新。

  1. Won't redirect the form even you do a RedirectAction().
  2. Will perform save , update and any modification operations asynchronously.
  3. Validate the Form using FormMethods - OnSubmit. So you are abort the Post
  4. This 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


  1. 将重定向形式。

  2. 将执行的操作既同步方式异步(有一些额外的code和护理)。

  3. Html.BeginForm总是会使用RouteTable借以了解物质的action属性值。

  4. 这将创建提交其值到服务器同步的HTTP请求的页面上的表单,在这个过程中刷新整个页面。

  1. Will redirect the form.
  2. Will perform operations both Synchronously and Asynchronously (With some extra code and care).
  3. Html.BeginForm will always use RouteTable to detrmine the action attribute value.
  4. This 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.

这篇关于Html.BeginForm()和ajax.beginform之间的差异()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆