URL http://localhost/mysite/mypage?param=123
works fine. However, if I want to put some special characters in param
, like ?
, /
, \
, then the URL becomes http://localhost/mysite/mypage?param=a=?&b=/
or http://localhost/mysite/mypage?param=http://www.example.com/page2?a=\&b=...
which won't work. How do I resolve this issue?
If anybody wants to pass the value from the query string which contains the special symbol like #,@ etc. then we have to use the UrlEncode method of the httpUtility. but if u want the correct value of the querystring then u have to use the UrlEncode.
The query component is a string of information to be interpreted by the resource. Within a query component, the characters ";", "/", "?", ":", "@", "&", "=", "+", ",", and "$" are reserved.
If this is the case and you want to send special characters such as +, /, or = in your HTTP request, your data string must be URL-encoded if you send the data using the PostData or QueryString input elements. If you send the data using the parameters specified on the Configuration tab, encoding is done automatically.
You have to encode special characters in URLs. See: http://www.w3schools.com/tags/ref_urlencode.asp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With