How to send multi-values under 1 variable in URL? this variable can have comma, single quote etc…
I have a messy made-up values inside a DropDownList(could be more). I want to pass these 3 values in URL under 1 variable. I am using ASCII to encode &’,/ symbols in url
- New York City / Buffalo
- Doctor’s, Nurse’s, hospital
- Red & Green
How can i indicate in URL that new value is about to start? i can’t use comma becuase single value can have multi commas. and I cant use & symbol bc url think its a new variable
I tried this but ^ symbol not allowed in url
test.com/Value=New York City / Buffalo^Doctor's, Nurse's, hospital^Red & Green
2
Answers
Assuming you have access to both form and destination pages, build a custom encoder to replace any invalid character in url (or query string) with something else and also a custom decoder at the destination page:
In your form page:
In somepage.aspx :
Just shove the 3 (or however many) into an array.
Use encoding, and then convert to JSON array.
So, say this markup:
And our target page has this:
So, say then this:
Code behind on target page is this: