开发者

How can I use partial views in ASP.NET?

开发者 https://www.devze.com 2023-01-04 07:15 出处:网络
I have done partial vi开发者_JS百科ews 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:

I have done partial vi开发者_JS百科ews 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消