Reputation: 5385
I would like to know if it is possible to update a section of the view asynchronously without moving that section into a partial view, in ASP.NET MVC 3.0. In webforms model, I can have all the mark-up in just one page, but I can still update a section of the page by specifying the target div on the update panel without moving that section into separate user control. partial view is only useful if that HTML fragment is used in multiple views. creating a partial view just for the purpose of asynchronous update will result in HTML for the page scattered in multiple files. I am using Ajax.BeginForm() to make an ajax call to the server. related article for this http://blogs.msdn.com/b/stuartleeks/archive/2011/04/13/asp-net-mvc-partial-rendering-and-ajaxattribute.aspx
Upvotes: 1
Views: 839
Reputation: 6772
If you have partial views with passion - you can return JsonResult to your ajax request and build html using javascript (jquery). But there are no analogs to web forms UpdatePanel control that allows to not separate partial view, because each request is action, and action should return view/partial view to generate html. I think that your problem is artificial.
Upvotes: 1