惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
S
Securelist
MyScale Blog
MyScale Blog
Jina AI
Jina AI
罗磊的独立博客
The Cloudflare Blog
美团技术团队
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
雷峰网
雷峰网
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
博客园 - Franky
博客园 - 聂微东
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MongoDB | Blog
MongoDB | Blog
T
Tailwind CSS Blog
Attack and Defense Labs
Attack and Defense Labs
博客园_首页
Latest news
Latest news
Apple Machine Learning Research
Apple Machine Learning Research
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Hacker News
The Hacker News
G
GRAHAM CLULEY
Simon Willison's Weblog
Simon Willison's Weblog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
U
Unit 42
D
Docker
Webroot Blog
Webroot Blog
N
Netflix TechBlog - Medium
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 最新话题
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
B
Blog
Recent Announcements
Recent Announcements
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
Security Latest
Security Latest
V2EX - 技术
V2EX - 技术
N
News | PayPal Newsroom
Microsoft Security Blog
Microsoft Security Blog

博客园 - enjoy .net

visual basic video series:Forms over data 无功倒送问题 变压器高低压侧的电流计算 爬电、爬距(泄漏距离)、爬电比距 使用BackgroundWorker进行Thread编程 VS2005的初体验 地板选购指南 IT服务管理时代已经到来 IT服务管理的效果分析 How to use the Install from Media feature to promote Windows Server 2003-based domain controllers 70-294读书笔记 TechED上海 术语: Tombstone/Tombstone Lifetime Windows 2003故障恢复 几乎没有管理的国企! ASP.Net 2.0中的Membership,Role和Profile ntdsutil的功能 体验了一次DNS的动态更新功能 Flexible Single Master Operations (FSMO)
关于ASP.Net 2.0中的Theme
enjoy .net · 2005-08-14 · via 博客园 - enjoy .net

1、Theme和CSS的定义
Themes are not the same thing as cascading style sheets.
Cascading style sheets enable you to control the appearance of HTML tags on the browser.
Themes, on the other hand, are applied on the server and they apply to the properties of ASP.NET controls. For example, you can use a theme, but not a cascading style sheet, to specify whether or not a GridView control displays a header or footer.
也就是说Theme针对ASP.Net Server Controls而CSS针对HTML中的Tags

2、Theme(主题)是在后缀名为.skin的皮肤文件中定义的

3、Default Skin和Named Skin
如果ASPX中的Server Control没有指明Control ID,则将应用Default Skin,否则将使用名称一致的Named Skin。注意如果要应用Theme,首先必须ASPX文件的头部即在Page指令中定义Theme,如下所示:
<%@ Page Theme="OrangeTheme" %>

4、将Theme应用到整个应用
在Web.Config文件中加入黑体所示的代码
<configuration>
    <system.web>
  <pages theme="OrangeTheme" />
    </system.web>
</configuration>

5、Theme和StyleSheetTheme
当应用Theme时,Theme中的属性的优先级要高于Server Control中指定属性的优先级。
而通过应用StyleSheetTheme,则可以使Server Control中的属性覆盖StyleSheetTheme中的属性。

6、Theme和CSS
可以将CSS文件放入Theme所在的文件夹,当页面应用Theme时,将自动应用CSS。

7、Theme要比CSS灵活一点,这主要体现在可以通过代码对Theme进行设置和访问。这样就可以很方便地定制用户喜爱的显示方式。

<%@ Page Language="VB" %>
<script runat="server">
    Sub Page_PreInit(ByVal sender As Object, ByVal e As EventArgs)
        Page.Theme = Request("dropTheme")
    End Sub
</script>
<html>
<head id="Head1" runat="server">
    <title>Dynamic Theme</title>
</head>
<body>
    <form id="form1" runat="server">
    
    <asp:DropDownList
        id="dropTheme"
        AutoPostBack="true"
        Runat="Server">
        <asp:ListItem Text="YellowTheme" />
        <asp:ListItem Text="RedTheme" />
    </asp:DropDownList>

    </form>
</body>
</html>

参考网址Creating Web Application Themes in ASP.NET 2.0