bl4kh4k
bl4kh4k

Reputation: 1440

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?

Upvotes: 9

Views: 5059

Answers (1)

Paweł Staniec
Paweł Staniec

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

Related Questions