ipona

What in heavens name am I doing?

ASP.NET and Styling

| 0 comments

James replies to my post about CSS and ASP.NET server controls. If course this is a dichotomy, and maybe there isn’t really a solution. If you want a fully CSS based site (or a majority of the styling through CSS) then you have to know what you are rendering. The adaptive controls are great, but they abstract you away from the rendered content, which is for many people perfectly acceptable. Does theming address this issue? I don’t think it does. Themes define properties for server controls, either using attributes or using CssClass – and then we’re back in the same situation. Using properties is probably the simplest way, but I find it makes the pages hard to read, and leaves little room for advanced styling.

I think the real problem is the issue of whether you want to use CSS styling or not. I do, but there are also problems with that approach, the chief one being data entry forms. for example, how do you produce a liquid data entry form, with labels to the left and entry fields to the right, in CSS? I want the labels to line up and the text entry fields to line up, as if they were in columns. You can put the labels in a div and float it left, but that doesn’t sit right with me somehow. You can try using the table styling, although this also has problems, as well as producing interesting cross-browser issues. At the moment I’m using the label control for the actual labels, and styling that with a width fixed in ems. It provides support for user text sizes, but again isn’t a perfect solution. The best solution is still tables, which I’m trying to move away from for styling.

I’m not sure there is a good solution to this and I think if you want advanced styling features you might have to compromise on the flexibility of the server controls.

[Listening to: Lullabye - Po' Girl - Po' Girl]

Leave a Reply

Required fields are marked *.