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

java - How to pass parameters between Request-Scoped Controllers? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -

ms access - C# - Using OleDbParameter on table name -