Difference between Ajax in Asp.Net & Asp.Net MVC

时间:2022-12-30 02:01:40

What is the difference between ajax in asp WEB FORMS and 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?

asp WEB FORMS中的ajax和asp mvc有什么区别?将ajax请求更快地使用Ajax.ActionLink和RenerPartialView从一侧更新某些块,然后使用另一方面的asp:UpdatePanel?

1 个解决方案

#1


8  

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. 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. 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.

另一方面,WebForms UpdatePanel发送整个视图状态,使请求更加庞大,让您几乎无法控制。它还有另一个缺点:它依赖于微软的javascrpt库,这可能是他们创建的库中最大的错误。从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对象。

#1


8  

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. 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. 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.

另一方面,WebForms UpdatePanel发送整个视图状态,使请求更加庞大,让您几乎无法控制。它还有另一个缺点:它依赖于微软的javascrpt库,这可能是他们创建的库中最大的错误。从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对象。