在Controller中:
public ActionResult LoadFoo()
{
return PartialView("Foo", aModel);
}
Javascript:
function loadFoo()
{
$.ajax({
url:
"LoadFoo",
success: function(data)
{
$(‘#div‘).html(data);
},
error:
function()
{
$(‘#div‘).html(‘Failed to load
Foo.‘);
}
});
}
ASP.NET MVC 动态加载 *.ascx,布布扣,bubuko.com
时间: 2024-12-29 23:12:59