views:

167

answers:

2

Good day,

In visual studio 2005, when I drop a webcontrol in the designer, I have to manually set the CssClass property. Is there a way to automatically set that property? The thing is, 90% of the time, I want to apply a css to my controls, but not always, so I cannot really use css style in html head. I thought about creating my own user control for each webcontrol, but that seems overkill for me.

Thank you!

A: 

Take a look at the laughably-named-but-still-an-improvement CSS Friendly Adapters

Out of the box they're an immediate upgrade, delving into how they work is an education on how to improve them further to your needs.

annakata
+1  A: 

I would think another way to achieve this (and because they are being applied 90% of the time) is by applying them as the default in your css file:

ie for a button

#page input { color: #454545; border: 1px solid #cccccc; width: 98%; }

and then only set the CssClass to the ones that you don't want

.RandomButton { }
Eric Ness