0

I have a some url data save in database that data is saved in as a encryption format like this below:

i.e: Wwrjf5OxVEznsWInNFwucg== 

that was okay but sum time encryption will be like this

i.e: Wwrjf5OxV+EznsWInNFwucg== 

in that case when i read the Request.QueryString["QueryString"] or Request.Params["Params"]

then i will get the string with the space between encryption if there is a value with "+" between the encryption so how can i solve this issue of "+" in QueryString or Params read.

please let me know a batter solution for solve this issue

thank you

2 Answers 2

1

You've sort of already answered this question in your title... You need to URL-encode it before it goes into your QueryString and decode it when it comes back out.

Write:

Request.QueryString["QueryString"] = HttpUtility.UrlEncode(myEncryptedString); 

Read:

var encryptedResult = HttpUtility.UrlDecode(Request.QueryString["QueryString"]); 
Sign up to request clarification or add additional context in comments.

Comments

0

you can use this for url encode and decode.

string encodedUrl = HttpContext.Current.Server.UrlEncode(Request.QueryString["QueryString"]); string decodedUrl = HttpContext.Current.Server.UrlDecode(encodedUrl); 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.