Home How do I specify different Layouts in the ASP.NET MVC 3 razor ViewStart file?
Reply: 0

How do I specify different Layouts in the ASP.NET MVC 3 razor ViewStart file?

user690
1#
user690 Published in June 25, 2018, 7:12 pm

I would like to have 2 separate Layouts in my application. Let say one is for the Public section of the website and the other is for the Member side.

For simplicity lets say all the logic for each of theses sites is wrapped neatly into 2 distinct controllers.

  • PublicController
  • StaffController

And that they each have a corresponding Layout for all the View under each.

  • _PublicLayout.cshtml
  • _StaffLayout.cshtml

How do I use the _ViewStart.cshtml file to specify that all View's / Action under "Public" use the PublicLayout and everything under "Staff" use the StaffLayout?

Thanks!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.321642 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO