ASP.NET MVC Razor pass model to layout

.net, asp.net-mvc, c#, razor

Solution

Seems like you have modeled your viewmodels a bit wrong if you have this problem.

Personally I would never type a layout page. But if you want to do that you should have a base viewmodel that your other viewmodels inherits from and type your layout to the base viewmodel and you pages to the specific once.

Problem

What I see is a string Layout property. But how can I pass a model to layout explicitly?

Original source

Related problems