HLRosenberger
asked on
Encoding URL
If I want to pass a SQL WHERE clause as a URL parm, I need to encode all the parms, correct? So, I'm using Server.UrlEncode(parms) prior to doing the Response.Redirect. Now, on the other end when I want to extract the parms, I guess I need to decode first? I can Server.UrlDecode. But if I'm using HttpContext.Current.Reques t.QueryStr ing to get the parm, how do I use both HttpContext.Current.Reques t.QueryStr ing and Server.UrlDecode in combination?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oops yes
ASKER
I tried that. it does not work. I have this:
report_id = Server.UrlDecode(HttpConte xt.Current .Request.Q ueryString ("report_i d").ToStri ng())
This part is nothing:
HttpContext.Current.Reques t.QueryStr ing("repor t_id")
because it does not find the "report_id" because everything after the ? in the URL is encoded. So, How do I extract parms from an encoded URL? If not encoded, this works fine:
HttpContext.Current.Reques t.QueryStr ing("repor t_id")
report_id = Server.UrlDecode(HttpConte
This part is nothing:
HttpContext.Current.Reques
because it does not find the "report_id" because everything after the ? in the URL is encoded. So, How do I extract parms from an encoded URL? If not encoded, this works fine:
HttpContext.Current.Reques
ASKER
I got it working. Only the data is supposed to be encoded. I was encoding everything after the ?.
Thanks!
Thanks!
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for HLRosenberger's comment #a39185478
for the following reason:
thanks
Accepted answer: 0 points for HLRosenberger's comment #a39185478
for the following reason:
thanks
ASKER
Thanks
ASKER
Server.UrlDecode(HttpConte