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

推荐订阅源

Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Security Latest
Security Latest
P
Palo Alto Networks Blog
AWS News Blog
AWS News Blog
NISL@THU
NISL@THU
T
Threatpost
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Latest news
Latest news
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
J
Java Code Geeks
P
Privacy International News Feed
阮一峰的网络日志
阮一峰的网络日志
S
Schneier on Security
博客园 - 聂微东
Project Zero
Project Zero
美团技术团队
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Scott Helme
Scott Helme
I
Intezer
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hacker News: Front Page
S
Security @ Cisco Blogs
博客园 - 司徒正美
O
OpenAI News
Last Week in AI
Last Week in AI
L
LINUX DO - 热门话题
酷 壳 – CoolShell
酷 壳 – CoolShell
SecWiki News
SecWiki News
月光博客
月光博客
S
Security Affairs
The GitHub Blog
The GitHub Blog
P
Privacy & Cybersecurity Law Blog
S
Secure Thoughts
V
V2EX
S
Securelist
F
Fortinet All Blogs
W
WeLiveSecurity
D
Docker
博客园 - 三生石上(FineUI控件)
Simon Willison's Weblog
Simon Willison's Weblog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
Cyber Attacks, Cyber Crime and Cyber Security
V
Visual Studio Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Engineering at Meta
Engineering at Meta

博客园 - 优雅旋律

四角号码 对照表 ScriptManager Bug Application_Start 不执行 loading 关机效果 ZT Asp.net 2.0 自定义控件开发专题[详细探讨页面状态(视图状态和控件状态)机制及其使用场景] ZT 数据库范式浅解 ZT 数据库设计系列:数据库设计5步骤 ZT Web Control 开发系列(一) 页面的生命周期 MarcHandler (Marc ISO2709) Resharper 4.0 终于RC了... GridView、DetailsView、FormView 、Repeater、DataList的区别 (ZT) 常用正则表达式 ZT linq(update) 更新用 自动赋值方法 利用对象序列化将购物车保存在Cookie中 (ZT) ajax tab 持久化数据 关于vs2008的Eval方法 重大失误 datapager分页问题 (点击两次)
动态设置主题(Theme) 一些注意
优雅旋律 · 2008-04-25 · via 博客园 - 优雅旋律

一般方法为创建pagebase类 使其继承自ystem.Web.UI.Page
其他需要动态这是主题的页面 继承自pagebase类

须注意的是对于设置Theme应重写Page_Init方法
而更为常用的StyleSheetTheme则应重写其属性来实现

 1        protected void Page_Init(EventArgs e)
 2        
 3            string theme = MyFunction.MyCache.GetCache("theme"as string;
 4            if (!string.IsNullOrEmpty(theme))
 5            {
 6                Page.Theme = theme;
 7            }
 
 8        }

 9
10        public override String StyleSheetTheme
11        {
12            get
13            {
14                string theme = MyFunction.MyCache.GetCache("theme"as string;
15                if (!string.IsNullOrEmpty(theme))
16                    return theme;
17                else
18                    return "";
19            }

20        }