Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a query string in ASP.net . It passes the values to the other page as expected but it shows an error when the passed value contains " ' " (single quote). like "It's" Is there any way I can get rid of this issue. I want to use query string. other wise I could have used sessions.
Posted

1 solution

Click it[^]

Encrypting Query Strings[^]
ans:
C#
 string value = "'a'b'+c";        
 Response.Redirect("~/WebForm3.aspx?id=" + HttpUtility.UrlEncode(value) + "");
//to retrive the value is as simple as it is
 Response.Write(Request.QueryString["id"]);
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900