Three Questions (with answers) about WebForm design:
1. I gather that FlowLayout is preferred to GridLayout, especially for
downlevel browsers. If so, it seems necessary to use tables to get a good
looking layout for a data entry form. Is this true?
Not really, as long as you have a really good style sheet that you can assign
various page elements to.
However, a lot of people still use tables for
this kind of thing, especially if they're not taking full advantage of
CSS. But CSS is not a replacement for tables. If you look at nearly any Web site
online, you will find tables (or in some newer cases DIV tags) are the mainstay
for layout control. CSS can be applied against tables to provide common layout
features.
One could also use a mixture of the two using which
ever approach is easier/cleaner.
2. A client has provided me with a fairly sophisticated CSS file which
they'd like to see used as much as possible. I've included the .css in the
project, but its styles don't seem to appear in the .style property sheet
dropdowns for various controls/elements. Is VS capable of integrating the styles
in this manner? Or, do I have to hand-code style info into the raw HTML?
Drop the style sheet on the design form - it will add a reference to it in the
HTML. Use CssClass to set the CSS class that you want applied to that element.
There isn't any drop-down for this (at least that I've seen), you just have to
type in the class name.
3. In general, are CSSs well-supported in ASP.NET? Any tips or "best
practices" on their use?
CSS is an HTML thing, so it just works. Learning CSS early on is one of the most productive things you can do for HTML
design. Thankfully VS.NET uses styles almost exclusively, so the HTML it
generates nudges you in that direction anyway.
ASP.NET has some issues with styles not
displaying in User Controls, which is a bit of a problem in visualization, but
there really isn't a good way around this in VS2003.
Bottom line: keep the HTML as clean and simple as possible, and use CSS styles wherever
possible.
from solutions provided by Paul Mrozowski and Rick Strahl in Message #1021097 and Message #1021100
|