Working with Themes in ASP.NET 2.0
page 6 of 10
by SANJIT SIL
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 44023/ 100

Defining Multiple Skin Options

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>

View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2021 ASPAlliance.com  |  Page Processed at 2021-03-01 5:08:03 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search