In .skin file of Theme’s Folder we can create multiple
definitions in respect of same server control. To create multiple definitions
of a single element we can use the SkinID attribute to differentiate among the
definitions. The value of SkinID can be anything.
Listing 10
<asp:Textbox Runat=”server” ForeColor=”Blue”
Font-Names=”Verdana” Font-Size=”X-Small” BorderStyle=”Solid” BorderWidth=”1px”
BorderColor=”Red”
Font-Bold=”True” />
<asp:Textbox Runat=”server” ForeColor=”Red”
Font-Names=”Verdana” Font-Size=”X-Small” BorderStyle=”Dotted”
BorderWidth=”5px” BorderColor=”Blue”
Font-Bold=”False” SkinID=”txtDotted”/>
<asp:Textbox Runat=”server”
ForeColor=”Yellow” Font-Names=”Arial” Font-Size=”X-Large” BorderStyle=”Dashed”
BorderWidth=”1px” BorderColor=”Red”
Font-Bold=”False” SkinID=”txtDashed”/>
In the above code there is no SkinID for the 1st TextBox
server control definition that means it will be used as the default style for
TextBox Server control. Where SkinID will be used, the particular definition of
TextBox Server Control will be used.
Listing 11
<% Page Language=“C#” Theme =”myTheme” %>
<html>
<body>
<form id=”frmThemeTest” runat=”server”>
<p>
<asp:TextBox ID=”txtThemeTest1”
Runat=”server”>TextBox1</asp:TextBox>
<p>
<asp:TextBox ID=”txtThemeTest2”
Runat=”server” SkinID=” txtDotted “> TextBox1</asp:TextBox>
<p>
<asp:TextBox ID=”txtThemeTest3”
Runat=”server” SkinID=” txtDashed”> TextBox1</asp:TextBox>
</body>
</html>