Solved

Encoding URL

Posted on 2013-05-20
7
463 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
Comment Utility
Server.UrlEncode(HttpContext.Current.Request.QueryString(parms).ToString())
0
 
LVL 1

Author Comment

by:HLRosenberger
Comment Utility
do you mean:

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

Expert Comment

by:QPR
Comment Utility
Oops yes
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Author Comment

by:HLRosenberger
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

771 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

11 Experts available now in Live!

Get 1:1 Help Now