Solved

Encoding URL

Posted on 2013-05-20
7
464 Views
Last Modified: 2013-05-21
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?
0
Comment
Question by:HLRosenberger
  • 5
  • 2
7 Comments
 
LVL 29

Accepted Solution

by:
QPR earned 500 total points
ID: 39182743
Server.UrlEncode(HttpContext.Current.Request.QueryString(parms).ToString())
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 39185478
do you mean:

Server.UrlDecode(HttpContext.Current.Request.QueryString(parms).ToString())
0
 
LVL 29

Expert Comment

by:QPR
ID: 39185489
Oops yes
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:HLRosenberger
ID: 39185535
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
 
LVL 1

Author Comment

by:HLRosenberger
ID: 39185551
I got it working.  Only the data is supposed to be encoded.  I was encoding everything after the ?.  

Thanks!
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 39185553
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
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 39185554
Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now