Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 997
Anton Putov Avatar asked Feb 19 '23 11:02

Anton Putov


1 Answers

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?

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.

But the underlying technology is absolutely the same: the web browser's XMLHttpRequest object.

like image 175
Darin Dimitrov Avatar answered Feb 27 '23 02:02

Darin Dimitrov