开发者

asp.net mvc3 disable masterpage for view

How can I disable the usual _Layout.cshtml for one view.

I try to use the content of the view aboutuser开发者_StackOverflow.cshtml to populate a div using ajax. Do you think this is a correct approch?

 $('#SelectUser').click(function () {

            $('#userPlace').html('<strong>Loading...</strong>');
            $.post('InfoFor?userSelect=' + ($('#usersoption:selected').val()), function (data) {
                $('#userPlace').html(data);
            });
        });


Inside this view/partial:

@{
    Layout = null;
}

or from the controller action serving it return a PartialView instead of a View:

public ActionResult Foo()
{
    return PartialView();
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜