views:

50

answers:

1

I have done partial views in ASP.NET MVC but now I want to convert it to ASP.NET. I have used AJAX and JavaScript. How can I convert the following:

<a href="#" onclick="LoadPartialView('#MainContentDiv', '<%=Url.Action("AdminHome", "Admin")%>')">Home</a>            ,
<input type="button" value="Submit" onclick="LoadPartialViewPost('#MainContentDiv', '<%=Url.Action("ViewPage", "Controller")%>', $('form').serialize())" />

to ASP.NET, or in other words, how can I load a partial view in ASP.NET?

A: 

Hey,

There aren't partial views in web forms, but you can load user controls through JQuery:

http://samuelmueller.com/2008/12/dynamicloader-plugin-dynamically-loading-asp-net-user-controls-with-jquery/

You can also route in ASP.NET 4: http://weblogs.asp.net/scottgu/archive/2009/10/13/url-routing-with-asp-net-4-web-forms-vs-2010-and-net-4-0-series.aspx

HTH.

Brian