Tuesday, March 31, 2015

skin file in asp.net

Skins are files with .skin extensions that contain common property settings for buttons, labels, text boxes, and other controls. Skin files resemble control markups ,but contain only the properties you want to define as part of the theme to be applied across pages.

Example
add skin file in your website
add code like(this code id for asp:Button)

<asp:Button runat="server" Font-Size="Large" ForeColor="Red" Text="Button" />

add .aspx file
write Theme="SkinFileName" in page tab(first line)
now add asp button it will come with some style which is specify in skin file for every button.



for specify different style for different button set SkinId property in skin file like
<asp:Button SkinId="1" runat="server" Font-Size="Large" ForeColor="Red" Text="Button" />
<asp:Button SkinId="2" runat="server" Font-Size="Large" ForeColor="Blue" Text="Button" />

for use that style in aspx file write code like
<asp:Button SkinID="1" ID="Button5" runat="server" Text="Button" /> 
<asp:Button SkinID="2" ID="Button6" runat="server" Text="Button" />

No comments:

Post a Comment