ASP.Net and the Confusion of GET and POST

By Deane Barker

My loathing for ASP.Net has been well-known in these pages, but part of me has made peace with it. There are some things about ASP.Net that I very much like, and I promise I’ll post about them one day. Today ain’t that day. I will never accept the stupidity of the server-side FORM tag and the…

The author criticizes ASP.Net for the confusion between GET and POST, arguing that it encourages users to POST everything, which is not in line with the HTTP spec and negatively impacts usability. The author uses the example of an example where they were unable to email a link to an Applebees menu due to the menu system being server-side events, which requires POST data. The author suggests that making the situation GET-friendly would have been easier.

Generated by Azure AI on June 24, 2024

My loathing for ASP.Net has been well-known in these pages, but part of me has made peace with it. There are some things about ASP.Net that I very much like, and I promise I’ll post about them one day.

Today ain’t that day.

I will never accept the stupidity of the server-side FORM tag and the confusion of GET and POST. Never. It drives me nuts – ASP.Net encourages you to POST everything, and that’s just not right. It’s not the intention of the HTTP spec, and it kills usability in a lot of situations.

Case in point – the Applebees menu system displayed above.

I’m having a lunch meeting at my office today for my church IT committee. We have an Applebees on the next block, and I wanted to email everyone a link to the menu for this restaurant. But I can’t.

Problem is, the developer who built their site used a DataGrid control to display the restaurant listings, and he bound the link buttons in it to server-side events. So those buttons in the picture are actual form buttons which POST data, not simple hyperlinks that link to an “email-able” URL. So when I click the buttons, I get a generic URL that’s useless without POST data…which I can’t send in an email.

Here’s the URL:

http://www.applebees.com/MenuLanding.aspx

If you click that, it will just loop back to the search form (unless you’ve been there before, because it appears to save your last restaurant as a cookie or session value).

The thing is, I know to check this. I know to look in the URL and make sure it’s valid on its own. But how many other people do? I wonder how many people every single day email that URL to someone and get a response like, “That URL you sent didn’t work for me…”

Why, oh why, do people do this? Oh yeah, because ASP.Net encourages you to do it.

(Sad thing is, making this particular situation GET-friendly wouldn’t have been much more difficult. It appears to be a cross-page postback anyway, so how hard would it have been to have just put the menu ID in the querystring and make the link an actual hyperlink? It’s not like it’s posting back to itself.)

Yes, I know, other languages encourage you to do stupid things too, however they’re usually confined to server-side and code-centric stupidity which doesn’t affect the user so much. The difference here is that ASP.Net infiltrates the client way too damn much, and stuff like this results.

This is item #196 in a sequence of 357 items.

You can use your left/right arrow keys to navigate

Copied...

Integration Console