ASP.NET URL Encoding/Decoding -



ASP.NET URL Encoding/Decoding -

i have 2 files htmlpage1.htm , webform1.aspx

htmlpage1.htm contains anchor tag href="webform1.aspx?name=abc+xyz".

when seek access querystring in page_load of webform1.aspx, "abc xyz" (abc [space] xyz). want exact value in querystring "abc+xyz"

note: href value cannot changed

any help appreciated

thank you.

this server.urldecode you:

request.querystring["name"] // "abc xyz"

option 1) can re-encode

server.urlencode(request.querystring["name"]); // "abc+xyz"

or raw query data

request.url.query // "?name=abc+xyz"

option 2) parse value

request.url.query.substring(request.url.query.indexof("name=") + 5) // "abc+xyz"

asp.net url encoding decoding

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -