ASP.NET MVC 动态加载 *.ascx
在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.');
}
});
}