tags:

views:

19

answers:

1

In my user control I got this inline CSS in which I have only css classes... like I am not setting any attribute or whatever on some ID..got only classes like :-

.sp
{
backgrond-image :url(blah blah);
}

and so on..

nothing of the sort

#id1
{
/* set some property here*/
}

Now my question:-

Do I need to worry about system generated IDs if the CSS in my user control got only classes ? like in my page source..the divs ID changes from their original ID to something like ctl00_ContentPlaceHolder2_ctl00_Banner_divBanner after adding usercontrol and master page ...

so changing IDs shouldn't make any difference..right ??

+1  A: 

Webforms, prior to .NET 4.0 all had auto-generated ID's. It was never a good idea to reference an ID as a CSS selector. With .NET 4.0 you have the ability to not auto-generate the ID's and use your normal "nice" ID's.

I would recommend sticking with class selectors, as most controls offer classname as a property.

Good article on the new .NET client ID's.

Dustin Laine
Thanks for answering and the link.
Serenity
so what I have done won't make no difference in whatever way..right ? haven't used ID selectors in my css
Serenity
Yes, the class selector would not change.
Dustin Laine