ASP.NET WebParts are bloated and stupid!

Is it just me, or do Microsoft developers have a chronic inability to understand web semantics? I.E. Use markup that makes sense and not abuse it for layout purposes?

Or why else would they insist on baking in tables into every WebPart and WebPartZone? And when I say baked in, I really mean it. It’s so far ingrained that it’s near impossible to strip it bare and still have some meaningful functionality before a deadline.

If you’re starting from scratch using an MS best practices set, forget it!

Even MS’ own semi-thought out mess to fix it, the “CSS Friendly Control Adapters”, are of no help, since they are limited to mucking other controls. If you want to know why I feel this way about the adapters, take a read at one of my earlier ramblings on the topic.

Suffice it to say, if you intend to make your layouts table-free, you may want to overlook WebPart functionality. Unless of course, you want create your own WebParts.

So I have a choice between stripping out everything and implementing my own inherited WebPart controls or simply creating a set of custom UserControls that mimic the functionality. Oh goody!

I may just go ahead and do that and post my code here. Meanwhile, if someone at Microsoft happens to come across this post, I created a demo of how I would like WebParts to behave. And yes, you can make it do what you want without using tables. I’m using my “Nova” theme that I created for my previous, “Recycle your layouts!“, post.

In keeping with my trend of not double checking any of my code I post here ;) … I put this up within an hour of setting aside a project after I ran into the table issue. There are probably a million different, and better, ways of doing this, but I just wanted to show how WebParts should behave.

Yes, there are glitches. And yes, you may want WebParts to behave differently, but you get the rough idea. I would recommend minimizing the content before moving.

Icons courtesy of Mark James and the Tango Desktop Project.

Now, it’s 1:09am (or 21359.1.9.14 according to the scientific datestamp) and I’m going to bed!

5 thoughts on “ASP.NET WebParts are bloated and stupid!

  1. Pingback: Tableless WebParts and WebPartZones « This page intentionally left ugly

  2. Hiya!, great post!!.
    i am doing something similiar with an adapter, but i am going to swap to your approach which i tried before but was rushing to finish and never got to finish it.
    How do you get around verbs?

  3. Spot on. I gave up and now use the Telerik docking control. The bitch of it is they make you learn them to get your ASP .NET cert.

  4. Pingback: Web Parts and SQL CE | the rasx() context

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s