CSS与Theme的作用——Asp.Net
时间:2010-09-07 来源:海滨小城
.skin文件的具体定义可以看下面的说明,总之,一类控件共有的属性都可以定义。
<%--
Default skin template. The following skins are provided as examples only.
1. Named control skin. The SkinId should be uniquely defined because
duplicate SkinId's per control type are not allowed in the same theme.
<asp:GridView runat="server" SkinId="gridviewSkin" BackColor="White" >
<AlternatingRowStyle BackColor="Blue" />
</asp:GridView>
2. Default skin. The SkinId is not defined. Only one default
control skin per control type is allowed in the same theme.
<asp:Image runat="server" ImageUrl="~/images/image1.jpg" />
--%>
还可以在Web.config的<system.web></system.web>里定义所使用的Theme.
<system.web>
<pages theme="GridViewTheme" />
</system.web>
CSS与Theme的组合就是在控件主题定义的时候,通过CSSCLASS里引用所使用的CSS文件了。