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.‘);
            }
        });
    }

ASP.NET MVC 动态加载 *.ascx,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!