Posts
295
Comments
27
Trackbacks
206
More ASP.NET 2.0 and CSS Woes
Some time ago I moaned about CSS based designs and the output ASP.NET 2.0 controls render. I've just discovered another problem, with the Login control. My design (done by a proper designer) calls for a styled login area, so naturally I use the LayoutTemplate of the Login control to provide that. The problem is that when you do this your content is wrapped within a table with a single row and single cell. Hance my styling doesn't work. I now have to decide whether to change the stylesheet or to abandon the login control. The latter isn't such an onus since I'm doing the layout myself, but I shouldn't have to do either. It makes no sense for the control to automatically wrap my content; if I'm setting the LayoutTemplate doesn't this imply I'm layout out the content myself? What good is a table with a single cell anyway?
[Listening to: Angel - Dave Matthews Band - Everyday]
posted on Sunday, July 03, 2005 2:06 PM Print
Comments
 re: More ASP.NET 2.0 and CSS Woes
Steve
7/6/2005 6:08 PM
kinda related to this, is there any way to change the "*" that the LoginControl uses for the Required validators?
 re: More ASP.NET 2.0 and CSS Woes
Dave
7/6/2005 6:11 PM
Yes, use the UserNameRequiredErrorMessage and PasswordRequiredErrorMessage properties.
 re: More ASP.NET 2.0 and CSS Woes
Garth H
9/2/2005 6:15 PM
Yeah, this really bugs me. All those wonderful controls that are supposed to reduce dev time, and even in the August CTP, they render in tables. the SiteNav control onthe Personal Website Starter has 4 nodes, but renders in 7 tables.

What were they thinking?
 re: More ASP.NET 2.0 and CSS Woes
Nabil Sourour
11/9/2005 4:52 AM
I am currently experiencing this Hell myself. I went so far as to begin writing a derived control that inherits from Login and overrides the render method, only to discover that the LayoutTemplate creates yet ANOTHER table. At this point I'm thinking of just tossing it and doing things the old fashioned way. What a waste!
 re: More ASP.NET 2.0 and CSS Woes
Justin Wignall
12/13/2005 12:42 PM
There is a solution is at:

http://blog.dreamprojections.com/archive/2005/04/08/783.aspx

I haven't implemented it yet myself as I'drahter not override the Login control just yet. If anyone has any joys with it it would be good to hear.
# re: More ASP.NET 2.0 and CSS Woes
Brian
3/1/2006 4:40 PM
I've used that last proposed solution and it works like a charm. I extended the previous blog post's code a bit, too: http://demarzo.net/archive/2006/02/28/706.aspx

I've also rewritten the CreateUserWizard control to not use tables. Once it's tested I'll post it on my blog. Same basic technique as the one for the Login control.
Comments have been closed on this topic.