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();
}
精彩评论