温故知新ASP.NET 2.0(C#)(2) - Themes(主题)
[1] 温故知新ASP.NET 2.0(C#)(2) - Themes(主题)
[2] 温故知新ASP.NET 2.0(C#)(2) - Themes(主题)
[3] 温故知新ASP.NET 2.0(C#)(2) - Themes(主题)
[2] 温故知新ASP.NET 2.0(C#)(2) - Themes(主题)
[3] 温故知新ASP.NET 2.0(C#)(2) - Themes(主题)
系列文章导航:
温故知新ASP.NET 2.0(C#)(1) - MasterPage(母版页)
温故知新ASP.NET 2.0(C#)(1) - MasterPage(母版页)
温故知新ASP.NET 2.0(C#)(2) - Themes(主题)
温故知新ASP.NET 2.0(C#)(3) - SiteMap(站点地图)
温故知新ASP.NET 2.0(C#)(4) - 缓存&SqlCacheDependency
温故知新ASP.NET 2.0(C#)(5) - Localization
温故知新ASP.NET 2.0(C#)(8) - DataSourceControl
温故知新ASP.NET 2.0(C#)(6) - Membership&RoleManager
温故知新ASP.NET 2.0(C#)(7) - Profile
温故知新ASP.NET 2.0(C#)(8) - DataSourceControl
主题测试-Theme
Themes/Theme.aspx
<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Theme.aspx.cs"
Inherits="Themes_Theme" Title="主题测试-Theme" Theme="Blue" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<p>
在页头部分指定Theme="Blue"</p>
<p>
相关主题文件,我觉得最好把样式写在css里然后设置控件的CssClass属性
<br />
<asp:Label ID="Label1" runat="server" BackColor="blue" ForeColor="white" />
<br />
<asp:Label ID="Label2" runat="server" BackColor="DarkBlue" ForeColor="white"
SkinId="Dark" />
</p>
<p>
<asp:Label ID="lbl" runat="Server" Text="不做任何设置(使用主题中的没设置SkinId的样式)" />
</p>
<p>
<asp:Label ID="lbl2" runat="Server" Text="设置BackColor为black(因为设置的是页的Theme属性,所以无法覆盖原有样式)" BackColor="black" />
</p>
<p>
<asp:Label ID="lbl3" runat="Server" Text="主题测试设置SkinID为dark(指定SkinId)" SkinID="dark" />
</p>
</asp:Content>
Inherits="Themes_Theme" Title="主题测试-Theme" Theme="Blue" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<p>
在页头部分指定Theme="Blue"</p>
<p>
相关主题文件,我觉得最好把样式写在css里然后设置控件的CssClass属性
<br />
<asp:Label ID="Label1" runat="server" BackColor="blue" ForeColor="white" />
<br />
<asp:Label ID="Label2" runat="server" BackColor="DarkBlue" ForeColor="white"
SkinId="Dark" />
</p>
<p>
<asp:Label ID="lbl" runat="Server" Text="不做任何设置(使用主题中的没设置SkinId的样式)" />
</p>
<p>
<asp:Label ID="lbl2" runat="Server" Text="设置BackColor为black(因为设置的是页的Theme属性,所以无法覆盖原有样式)" BackColor="black" />
</p>
<p>
<asp:Label ID="lbl3" runat="Server" Text="主题测试设置SkinID为dark(指定SkinId)" SkinID="dark" />
</p>
</asp:Content>
主题测试-StylesheetTheme
Themes/StylesheetTheme.aspx
<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="StylesheetTheme.aspx.cs"
Inherits="Themes_StylesheetTheme" Title="主题测试-StylesheetTheme" StylesheetTheme="Red" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<p>
在页头部分指定StylesheetTheme="Red"</p>
<p>
相关主题文件,我觉得最好把样式写在css里然后设置控件的CssClass属性
<br />
<asp:Label ID="Label1" runat="server" BackColor="red" ForeColor="white" />
<br />
<asp:Label ID="Label2" runat="server" BackColor="DarkRed" ForeColor="white" SkinId="Dark"
/>
</p>
<p>
<asp:Label ID="lbl" runat="Server" Text="不做任何设置(使用主题中的没设置SkinId的样式)" />
</p>
<p>
<asp:Label ID="lbl2" runat="Server" Text="设置BackColor为black(因为设置的是页的StylesheetTheme属性,所以可以覆盖原有样式)" BackColor="black" />
</p>
<p>
<asp:Label ID="lbl3" runat="Server" Text="主题测试设置SkinID为dark(指定SkinId)" SkinID="dark" />
</p>
</asp:Content>
Inherits="Themes_StylesheetTheme" Title="主题测试-StylesheetTheme" StylesheetTheme="Red" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<p>
在页头部分指定StylesheetTheme="Red"</p>
<p>
相关主题文件,我觉得最好把样式写在css里然后设置控件的CssClass属性
<br />
<asp:Label ID="Label1" runat="server" BackColor="red" ForeColor="white" />
<br />
<asp:Label ID="Label2" runat="server" BackColor="DarkRed" ForeColor="white" SkinId="Dark"
/>
</p>
<p>
<asp:Label ID="lbl" runat="Server" Text="不做任何设置(使用主题中的没设置SkinId的样式)" />
</p>
<p>
<asp:Label ID="lbl2" runat="Server" Text="设置BackColor为black(因为设置的是页的StylesheetTheme属性,所以可以覆盖原有样式)" BackColor="black" />
</p>
<p>
<asp:Label ID="lbl3" runat="Server" Text="主题测试设置SkinID为dark(指定SkinId)" SkinID="dark" />
</p>
</asp:Content>