I have to write this data in querystring:
http://localhost:1256/4.market.ph.local/WEP/Add.cshtml?data=me+&+you
I got an error because of that symbol '&' i used.
I have to write this data in querystring:
http://localhost:1256/4.market.ph.local/WEP/Add.cshtml?data=me+&+you
I got an error because of that symbol '&' i used.
In c# you can use this:-
HttpUtility.UrlEncode("http://localhost:1256/4.market.ph.local/WEP/Add.cshtml?data=me+&+you");
HttpUtility
is a part of System.Web
and this will ensure an of the non permitted query string char are url Encoded.
Once you do this you will get something like this http%3a%2f%2flocalhost%3a1256%2f4.market.ph.local%2fWEP%2fAdd.cshtml%3fdata%3dme%2b%26%2byou
On the receiver just decode it back.
Use urlencode($yourstring)
or if you are hard coding it, use %26
to represent the ampersand.