Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Use URLEncode

Reply
Thread Tools

Use URLEncode

 
 
Grey
Guest
Posts: n/a
 
      05-04-2004
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..
 
Reply With Quote
 
 
 
 
avnrao
Guest
Posts: n/a
 
      05-04-2004
You can use HttpUtility.UrlDecode to decode it.

Av.
"Grey" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)...
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..
 
Reply With Quote
 
 
 
 
David Jessee
Guest
Posts: n/a
 
      05-04-2004
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" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)...
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..
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
asp server.UrlEncode VS asp.net Server.UrlEncode Vs Php urlencode Dario Sala ASP .Net 1 11-15-2004 11:27 PM
Difference between System.Web.HttpUtility.UrlEncode and Server.UrlEncode? Andreas Klemt ASP .Net 4 01-22-2004 01:35 AM
URLEncode Problem from ASP.NET vtreddy ASP .Net 5 10-25-2003 09:27 PM
Datagrid HYperlinnk column URLEncode vtreddy ASP .Net 0 10-24-2003 01:32 AM
URLEncode Russ ASP .Net 3 08-04-2003 10:41 PM



Advertisments