Request.Form, Request.QueryString or Request[] collection
This week couple of people asked me about Request object related question. The question was when should Request.QueryString() or Request.Form or simply Request[] to be used??
When you are sure that incoming HTTP request is in POST format - you should use Request.[] collection and when you are sure its a GET request you should use Request.QueryString[] collection
However when you are not sure if the Request is either POST or GET then you should simply use Request["some variable"] . The good ( or if you like to call it bad) part of Request[] collection is it will only store all the QueryString and FORM variables but it also contains your "Cookies"!!!!

0 Comments:
Post a Comment
<< Home