This project is read-only.

Can I use RenderSection in the layout files?

Topics: Customizing Orchard
May 4, 2011 at 9:47 PM

Hi people,

I am new to Orchard and MVC 3.0, so I was looking at how in MVC 3.0 Razor, I could use RenderSection in the layout.cshtml

I was trying to do the same in the Orchard's theme layout, but 2 issues happen

1) Intellisense does not pick up RenderSection for some reason

2) The page fails with this error

The file "~/Themes/Contoso/Views/Layout.cshtml" cannot be requested directly because it calls the "RenderSection" method.
Anyone knows why?
May 5, 2011 at 10:22 AM

What exactly are you trying to do?

Did you mean to use RenderPartial?

May 5, 2011 at 8:22 PM

I have existing mvc3.0 sites which layout uses RenderSection, was wondering if that would be supported in Orchard, thats all.. :)