5

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?

tereško
  • 58,060
  • 25
  • 98
  • 150
Andreas Eriksson
  • 8,979
  • 8
  • 47
  • 65

1 Answers1

13

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;
}
James Harris
  • 1,904
  • 11
  • 15