Click here to Skip to main content
15,905,414 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

I want to C# code for control theme dynamically.

Main requirement is that Each category has specific theme.When any user runs the web application then the default theme will be loaded. All the user are registered under specific category. When user of particular category logged in then the theme related to particular category will be loaded. After when user logged out then it will again default theme will load.

Thanks,
Deepak
Posted

1 solution

Hi,

check this once I hope it can useful for you
HTML
<% if (Session["userRole"].ToString() == "Guest") {

       %>
<link href="Styles/basic.css" rel="stylesheet" type="text/css" />
       <%
   }
   else if (Session["userRole"].ToString() == "RootAdmin") {
   %>
<link href="Styles/basic_ie.css" rel="stylesheet" type="text/css" />
   <%

   } else if (Session["userRole"].ToString() == "Admin") {
   %>
<link href="Styles/demo.css" rel="stylesheet" type="text/css" />
   <%

   }
   else if (Session["userRole"].ToString() == "User") {
     %>
<link href="Styles/Site.css" rel="stylesheet" type="text/css" />
     <%
   } %>


All the Best
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900