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

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
F
Fortinet All Blogs
B
Blog RSS Feed
Last Week in AI
Last Week in AI
The Cloudflare Blog
大猫的无限游戏
大猫的无限游戏
人人都是产品经理
人人都是产品经理
P
Proofpoint News Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Microsoft Security Blog
Microsoft Security Blog
博客园 - 三生石上(FineUI控件)
Y
Y Combinator Blog
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
小众软件
小众软件
雷峰网
雷峰网
C
Check Point Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
博客园 - 司徒正美
U
Unit 42
量子位

博客园 - 优雅旋律

四角号码 对照表 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        }