技术开发 频道

如何在Web页中动态配置和保存自定义数据


【IT168技术文档】

1//读取背景颜色配置 2protected void Page_Load(object sender, EventArgs e) 3{ 4 if (!Page.IsPostBack) 5 { 6 this.DropDownList1.SelectedValue = System.Configuration.ConfigurationSettings.AppSettings["Backgroundcolor"]; 7 form1.Style.Add(HtmlTextWriterStyle.BackgroundColor, this.DropDownList1.SelectedValue); 8 } 9} 10//保存背景颜色配置 11protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) 12{ 13 System.Configuration.ConfigurationSettings.AppSettings["Backgroundcolor"] = this.DropDownList1.SelectedValue; 14 Response.Redirect(Request.Url.LocalPath); 15} 16
0
相关文章