Try our conversational search powered by Generative AI!

MVC - Can I have properties in the _layout file?


Can I have properties in the _Layout.cshtml file somehow?

The scenario I'm thinking of is to allow the editor to change the image file used as the logo for the site, a logo that resides within a layout file.

Since the layout is not part of a specific page, I'm not sure how I can bind properties to it?

Oct 21, 2013 14:31

This is done is the alloy mvc templates. I would recommend that you take a look on how it is being done there.


The property is not on the layout view itself, but added on the start page. A edit hint connection is then added to make the property editable despite being in the layout view.

Oct 21, 2013 15:06

Thanks Per for pointing that out.

Is there any documentation on edit hint? I don't understand what it is and how it works.

Oct 21, 2013 20:32

In the SDK: Editing hints in MVC.


Oct 21, 2013 21:23
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.