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.Request.QueryString to get the parm, how do I use both HttpContext.Current.Request.QueryString and Server.UrlDecode in combination?
LVL 1
HLRosenbergerAsked:
Who is Participating?
 
QPRConnect With a Mentor Commented:
Server.UrlEncode(HttpContext.Current.Request.QueryString(parms).ToString())
0
 
HLRosenbergerAuthor Commented:
do you mean:

Server.UrlDecode(HttpContext.Current.Request.QueryString(parms).ToString())
0
 
QPRCommented:
Oops yes
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
HLRosenbergerAuthor Commented:
I tried that.  it does not work.  I have this:

report_id = Server.UrlDecode(HttpContext.Current.Request.QueryString("report_id").ToString())

This part is nothing:

HttpContext.Current.Request.QueryString("report_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.Request.QueryString("report_id")
0
 
HLRosenbergerAuthor Commented:
I got it working.  Only the data is supposed to be encoded.  I was encoding everything after the ?.  

Thanks!
0
 
HLRosenbergerAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for HLRosenberger's comment #a39185478

for the following reason:

thanks
0
 
HLRosenbergerAuthor Commented:
Thanks
0
All Courses

From novice to tech pro — start learning today.