Andreas Eriksson
Andreas Eriksson

Reputation: 9027

Rendering views without master page in MVC3

I have a few views on my website that i need to include on a start page. However, just using Html.Renderaction renders the master page and the whole shebang.

How would i go about just rendering the content?

Upvotes: 5

Views: 6441

Answers (1)

James Harris
James Harris

Reputation: 1914

There are a few ways.

Make sure your returning PartialView from your Controller.

return PartialView("MyView");

Or you can set Layout to String.Empty or null inside the view.

@{
Layout=String.Empty;
}

Upvotes: 13

Related Questions