Skins and CSS in ASP.NET 2.0. I am completely confused!

S

shapper

Hello,

I am completely confused in relation to Themes and CssClass in Asp.Net
2.0.

Consider a custom control (MyControl) that I am creating which composed
by:

Panel_01
Table_01
Label_01
Image_01
Hyperlink_01
Panel_02
Label_02

Now, consider I want the text in Label_01 to be different of text in
Label_02.
And that I want to format the <a> tags in Hyperlink_01 as follows:

.a, .a:link, .a:visited {color: #950C00; text-decoration:
underline;}
.a:hover, .a:active {color: #950C00;text-decoration: none;}

How should I set the SkinIDs and CssClasses in my controls inside my
Custom control so I can make this work.

I am asking this because sometimes using Skins seems to be a limit over
CSS.
Sometimes I end up using many Skins...

Could someone give me some advice on this?

Thanks,
Miguel
 
G

GaryDean

The trick to doing Skin files is to add a page, call it Scratch.aspx, to
your project. Drag, for instance, a GridView onto it and then use VS design
time to make it look just like you want your gridviews for a given theme to
look. Then paste the definition into your .Skin file and remove the id
entry. That way you are letting VS do a lot of the work for you.

If you want some GridViews to look different than other GridViews then put
two definitions in the skin file with different CssClass entries. You
should be able to do this with your labels.
 

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

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top