ASP.NET MVC 动态加载 *.ascx
时间:2014-05-02 08:18:52
收藏:0
阅读:353
在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.‘);
}
});
}
评论(0)