The blog has moved to http://jessehouse.com/ ... Many google searches point here so I am leaving it operational, but there will be no new posts.
Showing posts with label razor. Show all posts
Showing posts with label razor. Show all posts

Wednesday, November 17, 2010

ASP MVC Razor templates with nested layout and sections

Using ASP MVC 3 with Razor views.

Ran into an issue with nested layouts and wanting to render a section in a top level layout, but define it in the view which uses a 'child' layout (master) page. This was generating a runtime error of:

The following sections have been defined but have not been rendered for the layout page... 

I posted some code to the asp.net forum and github. A nice workaround was supplied by 'Imran Baloch'