Working with Themes in ASP.NET 2.0
page 6 of 10
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 44627/ 110

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”
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” %>
<form id=”frmThemeTest” runat=”server”>
<asp:TextBox ID=”txtThemeTest1”
<asp:TextBox ID=”txtThemeTest2”
 Runat=”server” SkinID=” txtDotted “> TextBox1</asp:TextBox>
<asp:TextBox ID=”txtThemeTest3”
 Runat=”server” SkinID=” txtDashed”> TextBox1</asp:TextBox>

View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 

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

©Copyright 1998-2023  |  Page Processed at 2023-02-09 12:22:09 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search