Monday 14 May 2012

HTML - GET vs POST and how to retrive values on another page

// GET will append data to actual address
// GET with more then one QueryStrings (separated by &)
http://www.mywebsite.com/Reviews/ViewDetails.aspx?ReviewId=34&CategoryId=3
int reviewId = Convert.ToInt32(Request.QueryString.Get("ReviewId"));
int categoryId = Convert.ToInt32(Request.QueryString.Get("CategoryId"));


// POST data is sent in body of the request

// on another page use
HttpContext.Current.Request.QueryString["BrandId"];
// to get data.

No comments:

Post a Comment