动态更改主题为asp.net中的母版页 [英] Change theme dynamically to master pages in asp.net
本文介绍了动态更改主题为asp.net中的母版页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我必须对创建到主题的所有页面应用主题,一个是红色,另一个是橙色,如果我在下拉列表中进行了更改,则它仅显示默认红色,而这并没有改变我在母版页中实现的代码
我写了
Hi
I have to apply theme for all pages i created to themes one is red and another one is orange its showing only default red if i changed in dropdownlist it''s not changing i implemented code in master page
i wrote
protected void Page_PreInit(object sender, EventArgs e)
{
string thm;
thm = (string)Session["themeSelected"];
if (thm != null)
{
Page.Theme = thm;
DropDownList1.Text = thm;
}
else
{
Session["themeSelected"] = DropDownList1.Text;
Page.Theme = "Blue";
}
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
Session["themeSelected"] = DropDownList1.Text;
Server.Transfer(Request.FilePath);
}
在我更改了web.confing< pages主题="Orange">
之后
我在哪里弄错了?
and after i changed in web.confing <pages theme ="Orange">
where i did mistake?
推荐答案
这些小路应该可以帮助您:
ASP.NET 2.0(C#)中的动态主题 [如何在运行时动态更改asp.net 2.0中的页面主题 [ ASP.NET:指定母版页 [ ^ ]
These aricles should help you out:
Dynamic Themes in ASP.NET 2.0 (C#)[^]
How to change page theme in asp.net 2.0 dynamically at runtime[^]
A knowledgebase on changing theme at runtime: ASP.NET: Specifying the Master Page Programmatically[^]
这篇关于动态更改主题为asp.net中的母版页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文