Hi Scott,
Opinions and insights always welcomed even if you disagree.
> Re: Skins
>
[quoted text clipped - 4 lines]
> correct css links into my webforms for the selected theme. This
> approach lends itself to easily personalizing a site.
I agree and there are definitely cases where can skins can make some things
much better/easier/consistent. But from an HTML perspective, why didn't they
realize that for some things (such as grids and forms) that they are made up
of consituent bits (for instance prompts). I'll have to admit after taking a
closer look at the grid view, it has most of what I want (the ability to
style each of the pieces) and while I don't see it immediately I believe it's
possible to style individual cells if needed (such as formatting negative
numbers red). I shouldn't have lumped it in with FormView which was giving
me grief. My complaints with it are: How do you change the width of the
prompt (especially if the input on the right has lengths indicating the
amount of data to be entered), or worse, if you have multiple controls (say a
text box and a lookup button). How do you quickly right align or left align
them (ok left's easy :)). How do you control the font used for prompts
independantly from the data? The answer is you have to rewrite what it
generates (3 times). Would it have been difficult to use a label (or if
they're worried about downstream browsers) a div, span, anything but NOTHING!
> I think there will always be some difficulty applying styles to the
> complex ASP.NET 2.0 controls, because a control like GridView is at a
> much higher level of abstraction than the HTML it renders. It's like
> trying to control the native machine language opcodes generated at JIT
> time from C# or VB.NET - those opcodes should be opaque to a
> developer.
I respectfully disagree. I think abstracting it actually makes it easy to
create stylable content because they controll 100% of those little opcodes.
It just requires thought and planning. They can actually generate many
different html sequences based on values chosen for a control. (Just look at
third party controls). For a simple example consider a generic input widget
(not included). It might have the following properties: A required
indicator, a label/prompt, an input region, and an error indicator. This is
just a for instance based on many many web forms I've seen. One thing they
could control is changing an <input> tag to a <div> tag if the control was
read-only or in View mode. In fact if you think about it for many forms they
could have collapsed three templates into a single template while still
leaving the ability to create the other specialized templates. Based on the
applications and sites I've seen this would account for 95+% of the web forms
out there while reducing the work required to build and maintain that form by
a factor of 3! Recognizing the purpose of a form and building the
appropriate tool is important.
> ... goes a long way towards consistency and maintainability, and all
> the good stuff is still tucked away in a .css file.
totally agree (that's what made me peek at the gridview again) Thanks! :)
> Re: Jumpy GridView editing
>
> You might try the MaintainScrollPositionOnPostBack property. Jumpiness
> is unfortunately always been a part of the web. AJAX / Atlas can
> alleviate the problem to some extent, but smart clients will always be
> better at data input and editing.
The jumpy I was refering to is that when you switch from view to edit mode,
unless you spend a great deal of time and effort the grid will resize.
Update Cancel is a different width that Edit Delete. As far as I can tell
the only way to determine how wide to make the colum with the command buttons
is to run the app, save the HTML to a file and then start fiddling with colum
width while editing. (or if you're width is in the CSS, refreshing the page
and clicking retry every time. Next the view version of each column is
almost always a different width than the control. The solution is to set
both the item width and the control width for each column. Why exactly a
sane person would want both of those widths eludes me, but I'm sure there
might be an occasion.
> Re: Validation
>
> I imagine this is a case of time and priorities at MS, though I'm not
> sure what specific problem(s) you are driving at. Have you added two
> different validator types on a form and asked them to validate the
> same control ID?
You can certainly do that if you want for instance two !! after a control
with two errors and it will work fine. I would prefer what most web forms do
and just have a single ! indicating an error even if there are 12 errors
(that's what the summary is for).
> I think you'll find some good tips about developing to standards in
> this document:
>
> Building ASP.NET 2.0 Web Sites Using Web Standards
> http://msdn.microsoft.com/asp.net/community/authors/stephenwalther/default.aspx?
pull=/library/en-us/dnaspp/html/aspnetusstan.asp
Thanks, always looking for good reading (well most of the time, swamped in
all the reading between SQL 2005 (or is that the SQL 2005 suite?) and the
ASP.net stuff. I'll definitely give it a read though.
Larry