Click to See Complete Forum and Search --> : C# noob question reading forms
DARTHTAMPON
04-07-2005, 12:32 PM
Ok i stick mainly to programming in php but a new assigment has stuck me with writing an application using c# and .net. So my simple question is when a form is submitted how do i read the data. Need to know how to read both post and get.
thx
Tim Finnegan
04-07-2005, 08:37 PM
Use the Request.Params collection. All variables are there.
If you want just the POST, then you must use Request.Forms and the GET is in Request.QueryString.
HaganeNoKokoro
04-07-2005, 09:05 PM
Everything you ever wanted to know about the .Net Request Object:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebHttpRequestClassTopic.asp
Of particular interest will be the methods
Request.Form.Get - for POST returns a comma-separated string
Request.Form.GetValues - returns an array of strings
Request.QueryString.Get - same stuff but for GET
Request.QueryString.GetValues