Ok. In my ASP.NET MVC application I’m using Windows Authentication. I want to use different themes (layouts) for user groups. So my question is where/how do I intercept user authentication to apply theming for the given group.
Should I handle it inside default route/action (and check whether request is authenticated?).
Thanks!
We use a similar setup by creating multiple layouts, one for each role.
For example let’s say you have an Accounting role so you create a layout page that references the
Accounting.cssfile and any special .js files for that roleAt the top of that layout use this
And in your
_ViewStart.cshtmlpartial view put something like this:I put the admin role at top because an admin typically has access to all the other roles as well, that is to say, in my case, an Admin use also belongs to all the other roles. So setting that at the top will immediately filter out any users who are not an admin and check to see their specific role, and any Admin is quickly getting the admin layout