In call the following URL in Javascript.
var par = "Participant.aspx?ID=" + Id + "&NAME=" + Name+ "&FIRSTNAME=" + Firstname;
Sometimes the Name or the Firstname contains an "ampersand" or an "plus" sign.
For Example: Richard & Michael or Richard + Michael
On the server side, I read the query string like this:
Dim Name As String = Request.QueryString("NAME")
Dim Firstname As String = Request.QueryString("FIRSTNAME")
My problem is that if the query string contains a "plus" sign, then the sign is converted to space ( ' ' ) and if the query string contains a "ampersand", then everything after the "ampersand" is deleted.
I have tried several things like. Request.Form instead of Reqeust.Querystring and i also tried Server.URLEncode. But both not working suitable.
With URLEncode is the problem that if the Querystring contains spaces between the Name and the "plus" sign, the spaces also get converted to "plus" signs.
Do you have an idea how to solve this?
javascriptandc#. But yeah, the code sample is VB.Net. :-)