css and Theme skin.. [Resolved]

Posted by Naveenmanam under ASP.NET on 4/27/2010 | Views : 5061 | Status : [Member] | Replies : 2
What is the difference between css and Theme skin.can We apply css to web server control.

NaveenKumar


Responses

Posted by: Naveenmanam on: 4/28/2010 [Member] Starter

Up
0
Down

Resolved
thank you Bujji

NaveenKumar

Naveenmanam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bujji on: 4/27/2010 [Member] Starter

Up
0
Down
o CSS usually deals with HTML code. You cannot apply CSS to certain ASP.NET specific server controls which are not present in HTML.
o You can apply Themes and skins to all ASP.NET controls with less effort. Themes and skins can be uniformly applied on both windows and asp.net applications.
o You can apply single theme to each page where as multiple style sheets can be applied to each page.
o Themes don't override or cascade style definitions by default the way CSS generally do. But you can selectively override local property settings for a control using StyleSheetTime attribute in Themes.
o You can include CSS files in Themes which is applied as part of Theme structure but not vice-versa.
You can apply theming for only those properties that have ThemeableAttribute attribute set to true in their control class.
Skins
Generally, Themes contain skins. A skin file contains style definitions for the individual server controls. You can define skin settings for a control using similar markup which we use to add server controls to web page. Only difference you may find between skinned versions of control is that skinned version do not include ID attribute for control. You should retain properties for which you want to configure through Themes. We create .skin files in Theme folder. We can also mix all server controls style definition in a single skin file. Make sure all style definition files like CSS, skin files, Image files and other resources are included in Themes folder in your application directory.
<asp:button runat="server" BackColor="lightblue" BorderColor="AliceBlue" Font-Bold ="true" ForeColor="black"/>
Skin file
There are two types of control skins based on their scope. They are:
Default Skins: Control skin for which SkinID attribute is not set which means control skin is applied automatically for the controls of same type. For example: if you create a default skin for button then default button control skin will be applied for all the buttons on the page. The scope of default skin depends on where you define default skin.
Named Skins: Named Skins will have SkinID property set which means you can use named skins with a control only by setting control's SkinID property to specific named skinID. Named Skins do not apply for the controls by type.

Naveenmanam, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response