如何应用动态主题 [英] How to apply dynamic theme

查看:92
本文介绍了如何应用动态主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我想动态地为控件主题编写C#代码.

主要要求是每个类别都有特定的主题.当任何用户运行Web应用程序时,将加载默认主题.所有用户都在特定类别下注册.当特定类别的用户登录时,将加载与特定类别相关的主题.用户注销后,它将再次加载默认主题.

谢谢,
Deepak

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

推荐答案



一次检查,希望对您有用
Hi,

check this once I hope it can useful for you
<% 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


这篇关于如何应用动态主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆