-1

Before passing the query to another page it contains argument

UwHe6N8aN0ZAHhestx+adQ==

But when passed, the receiving page got

UwHe6N8aN0ZAHhestx adQ==

value instead.

The "+" got auto converted to space.

enter image description here

How can I stop the auto conversion of the query parameters?

Matt Clark
  • 27,671
  • 19
  • 68
  • 123
Tiong Gor
  • 73
  • 1
  • 8

1 Answers1

3

Because you should correctly UrlEncode that string:

var str = "UwHe6N8aN0ZAHhestx+adQ==";
Console.WriteLine(Uri.EscapeDataString(str));

Or, taking into account that it seems to be ASP.NET application, you can use HttpContext.Current.Server.UrlEncode instead.

Community
  • 1
  • 1
Eugene Podskal
  • 10,270
  • 5
  • 31
  • 53
  • 1
    @TiongGor If this answer helped you, you may [accept it](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work). – Eugene Podskal Jan 21 '17 at 14:30