Archive for November 16th, 2007

Why CSS Rules are Evil in ASP.NET

Anyone familiar with CSS knows that classes are generally reserved for controlling how an element looks (font, color, size, etc) and rules are generally reserved for where the element is positioned on the screen.  The reason for this is that rules correspond to the id attribute of the elements on the screen and if you are using well formed html, you can only have one element on the page with any specific ID.  That is, IDs are unique.

However, ASP.NET uses that exact same feature of IDs… that they are unique.. to ensure that an ASP.NET control or an html control with the runat=”server” attribute set also have unique IDs, and this is where all the problems start.

Read the rest of this entry »