Monday, 24. November 2008
Making ASP.Net Controls CSS Friendly11/25/2008 02:19 AM
I was trying to figure out how to make a vertical asp:menu stop taking up a line by itself and sit next to other elements and found the CSS Control Adapters for ASP.Net 2.0. The asp:menu control emits <table> tags by default instead of <ul><li> tags that are more CSS friendly, but these adapters fix this. Controls should never emit <table> tags or inline styles, so this is a nice thing to see from MS.
Unfortunately, the end result looks totally different from the non-CSS friendly version. It also also sits on a line by itself...grrr.
p.s., one important thing to note is that the CSSFriendlyAdapters.browser file needs to go into a subfolder named App_Browsers in your project. There are quite a few articles on the web that get the spelling of this wrong.