Cedric Aube
Cedric Aube

Reputation: 345

ASP.net: Changing Default webcontrol properties

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!

Upvotes: 0

Views: 339

Answers (2)

Eric Ness
Eric Ness

Reputation: 391

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 { }

Upvotes: 1

annakata
annakata

Reputation: 75814

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.

Upvotes: 0

Related Questions