Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC4 don't use master layout on redirect

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?

like image 505
bl4kh4k Avatar asked Jan 09 '13 01:01

bl4kh4k


1 Answers

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

like image 64
Paweł Staniec Avatar answered Nov 09 '22 07:11

Paweł Staniec