A cool feature, repeatedly asked for by users (of AspView, and of MonoRail in general).

 

When stating the layout name in the controller, you use a comma separated list of layouts to be applied, from the most general (outer) inward.

 

Example:

in the controller:

[Layout("Site, Admin")]
public class UsersController : SmartDispatcherController
{
    public void Index() { }
}

and given those schematic templates:

  • (layouts\site.aspx):
    SiteLayout
  • (layouts\admin.aspx)
    AdminLayout
  • (users\index.aspx)
    Index  

We'd get:

rendered view