1 minute read

In reply to this:

_IMHO viewstate is the second worst piece of the .NET Framework. The worst being "javascript:do_postback" instead of providing clean, lean and mean URLs. Oh wait, they are related -- the latter is the necesary workaround for the former._

Scott Hanselman writes:

_I think it's actually damned clever, and quite possibly neccesary. The HTTP/HTML combination needed an eventing subsystem built on top of it. DoPostback() does just that with support for Event Targets and Event Arguments. It's simple, supported, and clean._

I agree. I’ve said it before and I’ll say it again many times: the whole framework of nested controls within ASP.NET fits together in such a seemingly simple and logical way that it sometimes seems astounding that it took so long to get here. In fact, that is one of the facets of a well designed system. It takes effort to make something appear so obvious and it’s a sure sign you’ve achieved something good in my opinion.

Some people disagree: It’s not progress when developers who spend *years* on the platform learn more about how to hack it into submission than how it works in the first place.

To the naysayers who think spending hours on just getting a form to remember what was just typed in to it is fun, I say go back to ASP and revel in the fact that it is closer to raw HTTP. I like the new world order and I’ll stick with ASP.NET. I like the fact that when someone asks for a data capture form it doesn’t cause everyone to groan at the impending pain.

It seems to me that most of the people who don’t like viewstate (and I’m not referring to anyone in particular) develop this dislike after having seen it implemented badly. If you’re developing a scalable web application then it takes some amount of expertise. However, the world is also run by ragged Excel spreadsheets and hacked up VB applets written by people whose job is to just get stuff done. If ASP.NET also lets these people get their job done using a web server with an eventing model they’re familiar with and it works for them then I don’t have a problem with that.

Updated: