locked
get values from the post method RRS feed

  • Question

  • User-1662715574 posted

    hello ..i am newbie to asp.net

    i need to get the values of all the variables  posted using post method in asp.net

    is there way of halding it..?

    if so help me ..or can provide some useful links

    -Suresh

     

    Thursday, March 31, 2005 4:58 PM

All replies

  • User1181216341 posted

    use the Request object

    i.e. in c#

    string s = Request.Form["SomePostedValue"];

    note that if SomePostedValue is not passed you may end up with a null reference exception, you can use the above to get a blank string instead

    string s = (Request.Form["SomePostedValue"] != null) ? Request.Form["SomePostedValue"] : "";

    hope that helps?

    Sunday, April 3, 2005 7:35 PM