Pregunta

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
¿Fue útil?

Solución

You can use HttpServerUtility.UrlDecode()

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

Otros consejos

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top