By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,806 Members | 1,506 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,806 IT Pros & Developers. It's quick & easy.

Use URLEncode

P: n/a
How can I use the URLEncode in ASP.NET?? If i used URLEncode to encode the URL, how can I decode the URL with proper parameter values in ASP.NET?? I can encode the URL, but i cannot decode it properly...

Million Thanks..
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You can use HttpUtility.UrlDecode to decode it.

Av.
"Grey" <er*****@i-cable.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
How can I use the URLEncode in ASP.NET?? If i used URLEncode to encode the URL, how can I decode the URL with proper parameter values in ASP.NET?? I can encode the URL, but i cannot decode it properly...

Million Thanks..
Nov 18 '05 #2

P: n/a
the good thing is\s you don't have to worry about it.

for instance,
dim invalid_param as string = "abc/\/\&#x y z"
Response.Redirect("page.aspx?param=" & Server.URLEncode(invalid_param))

then inside of page.aspx......
dim theVariable as String = Request.parameters("param")


theVariable is now equal to "abc/\/\&#x y z". Since it was URLEncoded it it placed corrently into the QueryString. Because the params collection (or QueryString Collection) makes the assumption that you want it to be decoded.

"Grey" <er*****@i-cable.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
How can I use the URLEncode in ASP.NET?? If i used URLEncode to encode the URL, how can I decode the URL with proper parameter values in ASP.NET?? I can encode the URL, but i cannot decode it properly...

Million Thanks..
Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.