I am wondering how I can get the post data in a collection format?
Say if I have a form and one textbox named firstname, normally i type
var fn = txtFirstName.Text;
to get the data from that textbox. but I am wondering when i click on submit data to post the form how i can get the collection of raw post data?
thank you.
I want to get the post data instead of get.
You can access the Request object directly. It is a collection of all the form elements. You can loop through them or access them by name as follows:
Request["txtFirstName"]EDIT: If however, there’s a querystring variable with the same name, that will be used first. In that case,
Request.Form["txtFirstName"]should be used to instead.