0

hi i am unable to get complete url using Query Sting in asp.net C#. This is due to '#'. My url look like ID=OOP-Concepts-in-C#:-Code-Examples-and-How-to-Create-a-6

Code :string Qstring=Request.QueryString["ID"].ToString();

from this i am getting only "OOP-Concepts-in-C". After '#'(include # too), unable to get the string. Please help

Sukhvindra Singh
  • 200
  • 2
  • 14
  • What happens if you use `%23` instead of `#` in your URL – Vidmantas Blazevicius Mar 14 '18 at 14:07
  • 2
    you should url encode your query string data, that is not the only character that you may have a problem with. – Crowcoder Mar 14 '18 at 14:07
  • 1
    Everyting after `#` in a URL is NOT part of the query string. It's called a `fragment` and is *not* significant. It's typically used by single-page applications, eg to select tabs.. Fix the client. Make sure the value is encoded *before* posting it to the server. – Panagiotis Kanavos Mar 14 '18 at 14:14
  • By default, the browser doesn't send the fragment to the server. Depending on how you make that request, the browser may not even send that part at all. You can't fix that on the server – Panagiotis Kanavos Mar 14 '18 at 14:16

0 Answers0