动态应用主题
时间:2011-01-04 来源:太空人
1: <%--
2: 主题1
3: \App_Themes\FirstTheme\
4:
5: 默认的外观模板。以下外观仅作为示例提供。
6:
7: 1. 命名的控件外观。SkinId 的定义应唯一,因为在同一主题中不允许一个控件类型有重复的 SkinId。
8:
9: <asp:GridView runat="server" SkinId="gridviewSkin" BackColor="White" >
10: <AlternatingRowStyle BackColor="Blue" />
11: </asp:GridView>
12:
13: 2. 默认外观。未定义 SkinId。在同一主题中每个控件类型只允许有一个默认的控件外观。
14:
15: <asp:Image runat="server" ImageUrl="~/images/image1.jpg" />
16:
17:
18: <asp:Button runat="server" SkinID="skin1" Width="96px" BackColor="White" BorderStyle="Groove" Font-Bold="True" ForeColor ="Brown"/>
19:
20:
21: <asp:Button runat="server" SkinED="skin2" BackColor="#404040" Font-Bold="True" ForeColor="White" Width="92px"/>
22: --%>
23:
24: <asp:Image runat="server" ImageUrl="~\App_Themes\FirstTheme\W020101222388523142073.jpg"/>
1: using System;
2: using System.Configuration;
3: using System.Data;
4: using System.Linq;
5: using System.Web;
6: using System.Web.Security;
7: using System.Web.UI;
8: using System.Web.UI.HtmlControls;
9: using System.Web.UI.WebControls;
10: using System.Web.UI.WebControls.WebParts;
11: using System.Xml.Linq;
12:
13: public partial class _Default : System.Web.UI.Page
14: {
15: protected void Page_Load(object sender, EventArgs e)
16: {
17:
18: }
19: protected void Button1_Click(object sender, EventArgs e)
20: {
21: string url = Request.Path + "?theme=" + "FirstTheme";
22: Response.Redirect(url);
23: }
24:
25:
26: protected void Button2_Click1(object sender, EventArgs e)
27: {
28: string url = Request.Path + "?theme=" + "SecondTheme";
29: Response.Redirect(url);
30: }
31: }
相关阅读 更多 +