Welcome to WebmasterWorld Guest from 54.160.163.163

Forum Moderators: ocean10000

Message Too Old, No Replies

request.QueryString Disappearing + Please help

     

liquidstar

6:06 pm on Feb 7, 2006 (gmt 0)

10+ Year Member



http://address?EID=52/B66-9865<+3<:<39;=236@,16

The request.QueryString("EID") is producing EID=52/B66-9865< 3<:<39;=236@,16, dropping the + symbol and adding a space.

Any ideas?

[edited by: encyclo at 8:02 pm (utc) on Feb. 7, 2006]
[edit reason] delinked [/edit]

mattglet

6:34 pm on Feb 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to use the Server.URLEncode() method (assuming you're using ASP) to escape the characters before placing them in the querystring.

Argblat

4:50 pm on Feb 14, 2006 (gmt 0)

10+ Year Member



Request.Querystring interprets a "+" (plus) sign as a space....which is especially annoying when you are doing querystring encryptions and never know whats going to pop up up there.

The solution is to ALWAYS include .Replace(" ", "+") when you request querystring

Example:


string s = Request.QueryString["id"].Trim().Replace(" ", "+");

Hope that helps
-Mike

mattglet

5:33 pm on Feb 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The solution is to ALWAYS include .Replace(" ", "+") when you request querystring

The solution is to always escape your characters (using Server.URLEncode()) before sending them on to another page. You can then use the Unescape() function in classic ASP, or you can use Server.URLDecode() in .NET. There's no reason to mess around with replacing a bunch of different characters. A space isn't the only thing that gets messed up in a QueryString.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month