Is it possible to suppress the layout expressed in _ViewStart.cshtml
using ASP.NET MVC 3 for certain views of an app.
I understand that I can define the layout programmatically in the controller action. Maybe passing in ""
achieves that?
Is it possible to suppress the layout expressed in _ViewStart.cshtml
using ASP.NET MVC 3 for certain views of an app.
I understand that I can define the layout programmatically in the controller action. Maybe passing in ""
achieves that?
You have two options
1) Use return PartialView()
from controller, it won't take Layout from View start
2) Assign Layout = null,
@{
Layout = null;
}
Check-out this interesting discussion and answer by marcind around this subject
In order not to apply a layout, just assign null to the Layout property in your view:
@{
Layout = null;
}
<!DOCTYPE html>
...