Request.QueryString[] not giving proper reqult
I have a URL as: http://localhost:52893/books/viewmore?query=RecommendedTitles&subject=Mystery & Detective&slp=1 and i need to get subject as "Mystery & Detective" by using Request.Querystring["Subject"] in c#. since the Subject is containg "&" sybmol, the output on using Request.Querystring["Subject"] is "Mystery " alone. What should i do to get the proper value using Request.Querystring["Subject"]?
Suthish NairPosted Sep 10, 2013, 8:05 AM
Santhosh Kumar JayaramanPosted Sep 10, 2013, 7:35 AM
Before redirecting
Respose.Redirect( "http://localhost:52893/books/viewmore?query=RecommendedTitles&subject=" & Server.URLEncode( "Mystery & Detective" ) )
and then you can use
myLabel.Text = Server.URLDecode( request.QueryString["Subject"] )