Answer: A theme can contain only one Default Skin for each type of control. However, a
theme can contain as many Named skins as you can. Each Named Skin must have
a unique name.
Sample code:
TextBox.Skin:
<asp:TextBox SkinID="DashedTextBox" BorderStyle="Dashed" BorderWidth="5px" runat="server" />
<asp:TextBox BorderStyle="Double" BorderWidth="5px" runat="server"/>
ShowNamedSkin:
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="ShowSkin.aspx.cs" Inherits="DemoApp.ShowSkin" Theme="SimpleTheme" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Show Named Skin</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtFirstName" runat="server" SkinID="DashedTextBox">
</asp:TextBox>
<br /><br />
<asp:TextBox ID="txtLastName" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>
Asked In: Many Interviews |
Alert Moderator