How to set a layout page for a cshtml?

Topics: General
Dec 21, 2011 at 12: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?

Coordinator
Dec 21, 2011 at 12:25 AM

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

Dec 21, 2011 at 1: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 2:57 AM

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

Coordinator
Dec 21, 2011 at 5:22 AM

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