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.