Hacker News new | ask | show | jobs
by NKCSS 4651 days ago
His thoughts on ASP.NET WebForms are just; it's a piece of crap trying to make websites have state and you should stay away from it as far as possible.

I am a .NET developer like the poster, also been with the framework since the first beta (doing not just web, but also windows development), and I've had my share of frustrations with ASP.NET WebForms as well, but I quickly noticed that I could use Generic handlers (.ashx) to have a stateless experience, unlike the normal pages, which allowed me to add AJAX Handlers that did not suffer all the drawbacks. I just made simple HTML, added my own Ajax Requests (before jQuery) and had a blazing fast web app without all the fake 'state' that ASP.NET WebForms added.

Once MVC came around the corner, you basically get the Generic Hander + a way to properly structure your code. Once the Razor view engine came to be, there was also a way to maintain proper templates.

All in all, ASP.NET MVC has been great; you get all your .NET code for the back end, just HTML5, CSS3 and JavaScript on the front end, and no more fake 'state'.

1 comments

Was accessing a very slow HMO site yesterday. Peeked at the source and most of the wait was for the 800K ViewState string. Wasn't that hard to decrypt either. I think that is the source of most anti-ASP.Net sentiment.
The ViewState should be encrypted with the MachineKey[1] of the server and shouldn't allow you to decrypt it if they store sensitive data in it, but at least one control needs to request for the encryption or have the encryption set to always [2]

[1] http://msdn.microsoft.com/en-us/library/w8h3skw9(v=vs.85).as...

[2] http://msdn.microsoft.com/en-us/library/aa479501.aspx

The first outsourcing disaster I experienced was view state related. Back in 2003, a membership management app I inherited managed to hang of view state. Each page would throw 2.5Mb across a LAN. It sucked. It also had numerous bad patterns like UI driven SELECT N+1 hell. This is the norm for your average cheap custom build asp.net app.

We rewrote the entire thing in php (nice php!!) in three days and it's still used to this day without modification (even managed to get through a couple of security audits unmodified).