Question

When I click on below link :

<a href="default.aspx/video/?title=I am trying get the string"> hi</a>

It displays as :

http://example.com/default.aspx/title/?title=I%20am%20trying%20get%20the%20string

But I want it to display the link like :

http://example.com/default.aspx/title/?title=I_am_trying_get_the_string
Was it helpful?

Solution

You can use HttpServerUtility.UrlDecode()

 Server.UrlDecode(Request.QueryString["title"]).Replace("_", " ");

OTHER TIPS

You can use as While giving value to query string

<a href="default.aspx/video/?title=I_am_trying_get_the_string"> hi</a>

to get Desired value in output use String.Replace() as

String value = Request.QueryString["title"].ToString();
String valu = value.Replace("_"," ");

for details refer here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top