Style asp.net controls with CSS

B

Bobby Edward

Is it possible to stype the asp.net controls (asp:Login, asp:GridView,
asp:FormView; asp:DropDownList, etc...) with a standard css file?

Any suggestions?

Thanks...
 
N

Nathan Sokalski

I don't see why not. How are you defining the style rule in the css file
(what type of selector are you using)? If you are using a class selector for
the style rule, then all you should need to do is set the CssClass property.
However, because some controls do not simply generate one tag (such as
GridView, FormView, Login, and several others), you may want to look at what
tags are generated to determine where to put the CssClass property, you may
often need to put it in a control that is in the template used by the
control, or sometimes certain controls have an extra property for the style
of a certain part. But two of the key things that you can do are look at
what is generated so you know what html tags you are dealing with, and you
can also use the css child selectors in your css file to help when you only
have the opportunity to assign a value to one CssClass property. Just fool
around with these options and you can usually find a way to do it if it can
be done with css. Good Luck!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Stuck with html and css 25
Help with some CSS 2
CSS File does not really work? 1
CSS basic issue 2
Interfering CSS 1
External CSS 4
CSS Grid in a nutshell (Part 1) 0
CSS Grid inside slider not working... 1

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top