MVC page templates
Do I still have to create the page templates as web forms .master pages, or can I use a Razor layout instead?
bump
You can modify root MVC template with PowerTools. Does any one knows if this is possible to use different root templates depending different criteria: MVC controller or user settings in profile?
Thanks,
Denis.
Hi Denis,
It is not possible to change your root template on the fly because when the controller classes are executed, the page is already built and it is too late to change the root template.
You can create a layout file with a content like this:
<
link
href
=
"@Url.Content("
~/Mvc/Content/MyStyle.css")"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
script
src
=
"@Url.Content("
~/Mvc/Scripts/MyScript.js")"
type
=
"text/javascript"
/>
<
div
class
=
"bodyClass"
>
<
div
>
@RenderBody()
</
div
>
</
div
>
@
Layout = "~/Mvc/Views/Shared/_MyCustomLayout.cshtml";