简体   繁体   English

Asp.Net和Asp.Net MVC中的Ajax之间的区别

[英]Difference between Ajax in Asp.Net & Asp.Net MVC

What is the difference between ajax in asp WEB FORMS and asp mvc? asp WEB FORMS中的ajax和asp mvc有什么区别? Will be the ajax request to update some block using Ajax.ActionLink and RenerPartialView from one side faster then using asp:UpdatePanel from other side? 将ajax请求从一侧使用Ajax.ActionLinkRenerPartialView更快地更新一些块然后从另一侧使用asp:UpdatePanel

Will be the ajax request to update some block using Ajax.ActionLink and RenerPartialView from one side faster then using asp:UpdatePanel from other side? 将ajax请求从一侧使用Ajax.ActionLink和RenerPartialView更快地更新一些块然后从另一侧使用asp:UpdatePanel?

Yes it will be faster because it sends less information over the wire. 是的,它会更快,因为它通过网络发送的信息更少。 Also you have full control over what's sent over the wire and could optimize it. 此外,您可以完全控制通过线路发送的内容并对其进行优化。

On the other hands the WebForms UpdatePanel sends the entire view state making the requests more voluminous leaving you very little control. 另一方面,WebForms UpdatePanel发送整个视图状态,使请求更加庞大,让您几乎无法控制。 It also has another drawback: it relies on the Microsoft's javascrpt library which is probably the biggest mistake of a library that they created. 它还有另一个缺点:它依赖于微软的javascrpt库,这可能是他们创建的库中最大的错误。 It's a good thing that they deprecated it in favor of jQuery starting from ASP.NET MVC 3. That's why you are seeing more and more people using jQuery even inside their classic WebForms applications to do the AJAX stuff instead of relying on UpdatePanel. 从ASP.NET MVC 3开始,他们不赞成使用jQuery,这是一件好事。这就是为什么你会看到越来越多的人使用jQuery甚至在他们的经典WebForms应用程序中执行AJAX而不是依赖于UpdatePanel。

But the underlying technology is absolutely the same: the web browser's XMLHttpRequest object. 但底层技术完全相同:Web浏览器的XMLHttpRequest对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM