net5:Theme主题样式的动态变换,在内容页content中操作影响模板页的操作
原文發布時間為:2008-07-29 —— 來源于本人的百度文章 [由搬家工具導入]
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Default2 : System.Web.UI.Page
{
??? protected void Page_PreInit(object sender, EventArgs e)
??? {
??????? if (Request.QueryString["t"] != null)
??????? {
??????????? Page.Theme = Request.QueryString["t"].ToString();
??????? }
??? }
???
??? protected void Page_Load(object sender, EventArgs e)
??? {
??? }
??? protected void Button1_Click(object sender, EventArgs e)
??? {
??????? Response.Redirect("Default2.aspx?t=blue");
??? }
??? protected void Button2_Click(object sender, EventArgs e)
??? {
??????? Response.Redirect("Default2.aspx?t=red");
??? }
}
---------------------------------------------------------------------------
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
??? protected void Page_Load(object sender, EventArgs e)
??? {
??? }
??? protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
??? {
??????? ((Label)(Master.FindControl("Label1"))).Text = DropDownList1.SelectedValue;
??????? Label1.Text = DropDownList1.SelectedValue;
??? }
}
---------
App_Themes文件夾中的blue文件夾文件SkinFile文件內容如下:
<asp:GridView runat="server" AutoGenerateColumns="False"
??????????? CellPadding="4" DataKeyNames="au_id" ForeColor="#333333"
??????????? GridLines="None">
??????????? <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
??????????? <Columns>
??????????????? <asp:BoundField DataField="au_id" HeaderText="au_id" ReadOnly="True" SortExpression="au_id" />
??????????????? <asp:BoundField DataField="au_lname" HeaderText="au_lname" SortExpression="au_lname" />
??????????????? <asp:BoundField DataField="au_fname" HeaderText="au_fname" SortExpression="au_fname" />
??????????? </Columns>
??????????? <RowStyle BackColor="#EFF3FB" />
??????????? <EditRowStyle BackColor="#2461BF" />
??????????? <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
??????????? <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
??????????? <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
??????????? <AlternatingRowStyle BackColor="White" />
??????? </asp:GridView>
???????
???????
??????? <asp:GridView SkinId="pifu" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None">
??????????? <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
??????????? <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
??????????? <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
??????????? <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
??????????? <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
??????????? <AlternatingRowStyle BackColor="White" />
??????? </asp:GridView>
???????
?????? <asp:ListBox runat="server" BackColor="Blue" Font-Bold="True" Font-Italic="True"
??????????? Font-Names="Arial Black">
??????????? <asp:ListItem>fgh</asp:ListItem>
??????????? <asp:ListItem Value="gf">jdf</asp:ListItem>
??????????? <asp:ListItem>dfgh</asp:ListItem>
??????? </asp:ListBox>
StyleSheet文件內容如下:
body
{
color: blue;
font-style: italic;
font-family: 'Arial Black';
background-color: #ff33ff;
}
-----------------------
App_Themes文件夾中的red文件夾文件SkinFile文件內容類似
轉載于:https://www.cnblogs.com/handboy/p/7141607.html
總結
以上是生活随笔為你收集整理的net5:Theme主题样式的动态变换,在内容页content中操作影响模板页的操作的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 利用Spring的Application
- 下一篇: hadoop分布式搭建