Blogs

Intelligent Design

Asp.Net vs. Standards

A few months back I converted our site template from a table-based layout to a standards based design.  This was not a trivial task, in essence I "touched" every page in our app, which is more than 300 pages.  Recently we released major pieces of functionality, both using standards based html and heavy client-side functionality (ajax via prototype, effects/drag drop via scriptaculous).  For the entirety of the project I was in a constant struggle with asp.net and it's blatant disregard for supporting standards based design  and HTML standards in general.  Listed below are the issues that drove me to the edge of insanity, almost to the point of shunning off asp.net forever. 

INamingContainer

I understand the need to uniquely identify objects in the control tree.  But why does that id have to be persisted to the client?  How are you suppose to get a reference to an element in css or javascript if you can't rely on the id?  I've got an idea, stop trying to hold my hand and let me be responsible for uniquely identifying my controls.  This leads to abusing the class attribute and using it where it simply should not be needed.

One form per page with runat="server"

I've been told that this has since been addressed in 2.0.  In 1.1 this is unacceptable, for instance, in our site template we have a drop down within our sub navigation (don't ask me why it is in the navigation) that contains all ministries a user has rights to.  This drop down should be contained within it's own form, along with a form containing all controls within the main content section.  but because a) System.Web.UI.WebControls.DropDownLists must be contained within a form with runat="server" and B) only one form with runat="server" is allowed on the page; I now have to encapsulate the entire sub navigation and content in a single form.  There-by sacrificing good design.

Controls render horrendous HTML

So I've just added a System.Web.UI.WebControls.DataGrid and I've set the DisplayHeader to true and HeaderText to "Name".  Ok, let's see here, we have a grid that should be displayed as a table (check).  We have a header for that grid/table, so that should be a table header, th tag, (che....oh wait).  Where is the th tag?  There are too many of these instances to list each one.

System.Web.UI.WebControls.Label renders as a span tag

Did anyone on the asp.net team even look at the HTML specification?

No support for OPTGROUP element

Seriously?  I mean, come on, DID ANYONE EVEN LOOK AT THE HTML SPECIFICATION?

Quirksmode is default for new aspx pages

If you truly support web standards how can you default a document to Quirksmode.

No easy way to get HTML from a server-side control

A significant advantage of ajax is not having to render the entire page, especially if sections of the page may or may not be used.  On the server an ajax request is not handled any differently than clicking a button or link.  There is a significant advantage in being able to request pieces of HTML from the server and respond with that HTML to be rendered on the client (AHAH).  but because asp.net controls must a) be apart of a form with runat="server" and b) cannot be rendered before the form is rendered, this is impossible.  Besides creating a user control and then loading that control at runtime there is no way to get HTML from an aspx page.  Well, no way that I could come up with.

System.Web.UI.WebControls.DropDownList must be contained within a form with runat="server"

Why? 

Did I miss something?  I'm not too terribly familiar with the machine.config or the web.config, maybe I forgot to include <standards-mode enabled="true" />?  Microsoft's marketing machine can preach all they want about standards support (why do I still have to use the Holly Hack in IE7, wasn't this bug fixed? ), but marketing will only go so far.  People will tell me that concessions have to be made in order to support the designer and being able to drag and drop a control from the toolbox.  But you know what, I don't care, if your dragging and dropping controls from the toolbox then you need to find another profession.  Creating web applications is not for you.

Does anyone else struggle with these issues? 

Published Friday, February 02, 2007 5:29 PM by mvasquez
| Filed under: , , , , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 
Submit