Ray's Asp.net Blog
Answers and code snippets from ASP.NET projects (Webforms/MVC/Classic ASP)
Pages
(Move to ...)
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
‹
›
Home
View web version
No comments:
Post a Comment