Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Request.QueryString - replacing + (plus) sign with space

abcd.aspx?ST=f7aABcBdHIm7E8/0SAWKGtz8qKkhwNpJuZ+Jh+Jg+jg=&ET=d0698IjyKXsfkDDAmgy79kOd8+ONzX6IlgSrDME0QHw=

when I use the below code in my .cs page:

Request.QueryString["ST"]

It returns the value:

"f7aABcBdHIm7E8/0SAWKGtz8qKkhwNpJuZ Jh Jg jg="

It replaced the + sign with a space character (" ").

Any idea how to solve this?

like image 993
Bhavin Rana Avatar asked Oct 22 '25 20:10

Bhavin Rana


1 Answers

+ sign has a semantic meaning in the query string. It is used to represent a space.

Server.UrlEncode(Request.QueryString["ST"])

You can use Server.UrlEncode. Spaces ( ) are converted to plus signs (+).

Ref: http://msdn.microsoft.com/en-us/library/ms525738%28v=vs.90%29.aspx

like image 112
Satpal Avatar answered Oct 24 '25 08:10

Satpal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!