Ray's Asp.net Blog
Answers and code snippets from ASP.NET projects (Webforms/MVC/Classic ASP)
Pages
Event registration app with QR/Paypal
Home
Monday, December 12, 2011
How to render a view without layout in ASP.NET MVC?
In_ViewStart.cshtml, Check if it is an ajax call. If yes set layout to null
if
(Request.IsAjaxRequest())
{
Layout =
null
;
}
else
{
Layout =
"~/Views/Shared/_Layout.cshtml"
;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment