Reputation: 1440
I have a controller that returns the view using MVC4 however for this specific view I don't want it to use the master layout I have in place. Is this possible to achieve?
Upvotes: 9
Views: 5059
Reputation: 3181
put
@{
Layout = null;
}
on the top of your view file. You can also provide path to any other layout file.
you can also change your return statement in given action to
return PartialView();
so it will not attempt to wrap result of your action with layout file
Upvotes: 16