In addition to using Request.Form
and Request.QueryString
and depending on your specific scenario, it may also be useful to check the Page
's IsPostBack
property.
if (Page.IsPostBack)
{
// HTTP Post
}
else
{
// HTTP Get
}
Use the
Request.Form[]
for POST variables,
Request.QueryString[]
for GET.
Source: Stackoverflow.com