This project is read-only.

How to set a layout page for a cshtml?

Topics: General
Dec 21, 2011 at 1:23 AM

In mvc3,I can use Layout = "~/myLayoutPage.cshtml" to  set a layout .

But in orchard , I found the Layout does not allowed "set".

So please tell me how can i  set a layout page for a cshtml?

Dec 21, 2011 at 1:25 AM

For a specific page? Use URL alternates (it's in the Designer Tools module)

Dec 21, 2011 at 2:06 AM

My action has attribute  [Theme(false)] so the URL alternates does not work.

Oh,did a [Theme(false)] action can be have a layout? I haven't think about that...

Dec 21, 2011 at 3:57 AM

You can return a custom ActionResult implementation and specify a different layout.

Dec 21, 2011 at 6:22 AM

That's correct: a non-themed controller will not have layout.