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

posted on 2014-05-02 05:46  橡皮鱼  阅读(235)  评论(0编辑  收藏  举报