user670800
user670800

Reputation: 1115

asp.net mvc partial page update vs. asp.net aspx partial page update

I have some questions: I tried out asp.net mvc and have jquery ajax [http get] to retrieve partial mvc views , which will be used in partial page update. I wonder this is a acceptable approach to do partial page update.

Now I am working with a asp.net aspx project. How to do a partial page update with asp.net ?

Upvotes: 1

Views: 1213

Answers (1)

Thomas
Thomas

Reputation: 1197

Yes its an acceptable solution. You could use the .load() function as well which calls $.ajax internally.

$('#MyDiv').load('/MyURL/GetParialView');

That will load the html returned from the URL into the div with an id of 'MyDiv'.

By asp.net I assume you mean Web Forms. Both MVC and web forms are built on ASP.NET. However in web forms you can still use jquery to return json or html from a webservice. Web forms also uses a control called an update panel that abstracts some of the complexities of Ajax. A word of caution though update panels can be very easy to implement but can become confusing when dealing with larger complicated applications.

Upvotes: 1

Related Questions