I am new to asp.net mvc platform. I’m developing with razor template engine in mvc 3. I’ve created a layout page for all view pages but in some cases I need different page headers for different view pages. For example I have to insert additional script elements to page header to validate data in form pages.
I want to know is there any way to add html element to layout page’s header from view page?
Thanks in advance.
You could define a section in the head part of the master page:
and in the view define this section:
You also have the possibility to test if a section is defined: