ASP.NET’s equivalent of doGet() and doPost()

Another day at work, another thing learnt about ASP.NET – I was trying to code up a login control today and I needed a method that only accepts post requests, but found nothing obvious that is equivalent to the doGet() and doPost() methods in Java servlets (well… alright, I guess you could use SupportClass.ServletSupport class as described here…).

Anyway, the solution for getting the form parameters in different requests turned out to be rather simple:
get – Request.QueryString
post – Request.Form

And to determine the current submission method – Request.HttpMethod.

Leave a Reply

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

You are commenting using your 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

%d bloggers like this: