日期:2014-05-17  浏览次数:20449 次

关于asp.net换肤问题
目前想做一个博客系统,遇到一个问题,就是每个博客会员都有自己风格的主题界面,这个该如何实现呢?我目前是想先定死几个主题让用户选择,减少难度,不知道具体怎么实现?求指教啊~~~~~越详细越好啊 或者发个详细教程的链接也行啊~~~~~

------解决方案--------------------
aspnet有皮肤功能,用起来不是那么顺
可以自己定义若干套css,根据主题加载不同的css不就可以了
------解决方案--------------------
写CSS样式控制,然后自己点击主题后,套用CSS样式刷新。
------解决方案--------------------
做几套主题供用户选择,会比较简单,要是用户自定义,会难很多吧,没做过。
------解决方案--------------------
哎,,,怎麼不考慮用?

Iron.Speed.Designer
------解决方案--------------------
Asp.net自带的有Theme功能
在App_Themes下添加多套Skin,功能套用Skin就可以了!
------解决方案--------------------
参考 
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/webmailgrid/defaultcs.aspx

右上角有一个切换风格的按钮
------解决方案--------------------
说一下思路,同7楼一样。在页面中添加一个dropdownlist控件,变换主题。给你个代码参考:
 protected void Page_Load(object sender, EventArgs e)
{

}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
string url = Request.Path + "?theme=" + DropDownList1.SelectedItem.Value;
Response.Redirect(url);

}

void Page_PreInit(Object sender, EventArgs e)
{
string theme = "Theme1";
if (Request.QueryString["theme"] == null)
{
theme = "Theme1";
}
else
{
theme = Request.QueryString["theme"];
}
Page.Theme = theme;
ListItem item = DropDownList1.Items.FindByValue(theme);
if (item != null)
{
item.Selected = true;
}
}