Sunday, 2 February 2014

How we will use THEME in Asp.net


Note: 

1. Firstly add one skin file in your project 

put this code inside of skinfile form (skinfile.skin)


<asp:Label runat="server" BackColor="Yellow" ></asp:Label> 
<asp:TextBox runat="server" ForeColor="Black" BackColor="Yellow"></asp:TextBox> 
<asp:Button runat="server" ForeColor="Black" BackColor="Red" /> 

put this code inside of new form


<body> 
<form id="form1" runat="server"> 
<div> 
<table> 
<tr><td> <asp:Label ID="name" runat="server" Text="Name" ></asp:Label></td><td><asp:TextBox ID="txtname" runat="server" ></asp:TextBox></td></tr> 
<tr><td> <asp:Label ID="fname" runat="server" Text="Father Name"></asp:Label></td><td><asp:TextBox ID="txtfname" runat="server"></asp:TextBox></td></tr> 
<tr><td> <asp:Label ID="add" runat="server" Text="Address"></asp:Label></td><td><asp:TextBox ID="txtadd" runat="server" TextMode="MultiLine"></asp:TextBox></td></tr> 
<tr><td></td><td><asp:Button ID="submit" runat="server" Text="Submit" /><asp:Button ID="cancel" runat="server" Text="Cancel" /></td></tr> 
</table> 

</div> 
</form> 
</body> 

Note: 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Theme.aspx.cs" Inherits="Theme" EnableTheming="true" Theme="SkinFile" %> 

Write following property in this form: 
1. Theme ="SkinFile" // this is theme name 
2. EnableTheming="true"

No comments:

Post a Comment