Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Request parameters not recognizing & as separator

I have an HttpHandler that reads the parameters from the request URL by simply using context.Request["param1"]. The thing is that my website is xHTML compliant so all links are encoded. So I have a link in the format of: http://mydomain.com/?param1=a&param2=b.

The problem is that Request["param2"] is not recognized. Instead it thinks the second parameter is "amp;param2". It does not realize that the & is representing & in the URL. How would I tell "Request" that the links are expected to be xHTML compliant?

like image 300
TruMan1 Avatar asked Sep 13 '26 13:09

TruMan1


1 Answers

You need to UrlEncode your links, not HTMLEncode.

The first one gives & = %26 while the latter (the one you're using) gives & = & and the handler is breaking the parameters by the first & in &

like image 100
ChrisAnnODell Avatar answered Sep 16 '26 01:09

ChrisAnnODell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!