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开发者_JS百科 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 ?
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.
精彩评论