如题
------解决方案--------------------------------------------------------
如果你只要修改颜色,那么就按照我1楼那样做就可以了,稍微做下修改,每个页面都加上
<body bgcolor="<%=strColor%>">,
定义一个基类PageBase.cs,所有页面继承这个类,在这个类里设置
public string strColor;
pagebase.cs
/// <summary>
/// the base class for Page。
/// </summary>
- C# code
public class PageBase : System.Web.UI.Page{ #region 变量声明 public string strColor; #endregion #region 本类构造函数 public PageBase() { strColor="#cc00ff"; } #endregion}
------解决方案--------------------------------------------------------
自已写个类
- C# code
public static System.Drawing.Color TheColor { get { if (System.Web.HttpContext.Current.Session["TheColor"] != null) { return (System.Drawing.Color)System.Web.HttpContext.Current.Session["TheColor"]; } else { return new System.Drawing.Color(); } } set { System.Web.HttpContext.Current.Session["TheColor"] = value; } }
------解决方案--------------------------------------------------------