ASP.NET Themes

Themes in ASP.NET could be used for lot of very useful purposes like maintaining consistent look and feel over the server controls in the website. However if you want to change the look and feel of “a “ control  it could be a pain.

The EnableTheming property doesn’t seem to work for whatever strange reasons.

To have more control over themes :

the Pages node in Web.Config has two attributes

1) Theme: According to MSDN if you set this with your theme. The theme that is present in App_Themes takes precedence over the local styling(could be CSS) that has been applied to your control. So if you set the Theme attribute no matter what you don’t have control over how to change  a server control looks in a particular instance.

2) StyleSheetTheme: The second attribute is kind of useful according to me. MSDN says you can retain the page level CSS precedence  over the style that has been used in App_Themes.

So, I suggest according to requirement we use Theme and StyleSheetTheme Properties in Web.Config.

 

Hope that helps!

 

Happy Coding!!!

0 Responses to "ASP.NET Themes"

Post a Comment