URL Encoding & Decoding ?
-
Hi, I am Encoding my Url like : Response.Redirect("~/Default.aspx?"+Server.UrlEncode(("I1=18&I2=1&I3=506"))); It is working Fine,But When i tried to Decode the Url like : Server.UrlDecode(Request.QueryString.ToString()); It is not working as expected , It is returning the Count of Query String as 1,But i expect it as 3, Plz help me how to Decode the Querystring ? Thanx in Advance!!!!
-
Hi, I am Encoding my Url like : Response.Redirect("~/Default.aspx?"+Server.UrlEncode(("I1=18&I2=1&I3=506"))); It is working Fine,But When i tried to Decode the Url like : Server.UrlDecode(Request.QueryString.ToString()); It is not working as expected , It is returning the Count of Query String as 1,But i expect it as 3, Plz help me how to Decode the Querystring ? Thanx in Advance!!!!
-
there r several predefined algorithm in .net security package which can be used dirctly to encode &decode the url............ok
i used the Server.EncodeUrl() method , i am talking based on this.
-
Hi, I am Encoding my Url like : Response.Redirect("~/Default.aspx?"+Server.UrlEncode(("I1=18&I2=1&I3=506"))); It is working Fine,But When i tried to Decode the Url like : Server.UrlDecode(Request.QueryString.ToString()); It is not working as expected , It is returning the Count of Query String as 1,But i expect it as 3, Plz help me how to Decode the Querystring ? Thanx in Advance!!!!
You should not encode the whole string "I1=18&I2=1&I3=506". Since you are encoding the three query strings I1=18&I2=1&I3=506 into one, it is loaded as a single query string in the target page. To avoid this, Encode querystring parameter I1 and the value 18 separately and join using '=' operator. Repeat this for next paramters and theri values and join with the previous set using '&'. It should be like below Response.Redirect("~/Default.aspx?"+ "encodeedI1=encoded18& encodedI2= encoded1& encdoedI3=encoded506"; Then only you can get three Query Strings in the Default.aspx.