Solved

URLEncode in asp.net

Posted on 2003-12-05
7
2,017 Views
Last Modified: 2013-11-25
The Server.URLEncode method in classic asp worked great: it only encoded invalid url characters, producing a legal url string.

The URLEncode method I found for asp.net behaves strangely: it encodes EVERY character (maybe except for alphanumeric chars. . .??) in a url, even the legal ones.

so the following illegal url SHOULD be coded as

bad: http://www.google.com/my special folder/my page.html
good: http://www.google.com/my%20special%20folder/my%20page.html

the .net version even encodes the forward slashes (legal in url), so the resulting url is *wrong*

So: Is there a method in .net that behaves exactly like classic asp's Server.URLEncode() method?
0
Comment
Question by:SweatCoder
  • 4
  • 2
7 Comments
 
LVL 20

Accepted Solution

by:
jitganguly earned 25 total points
ID: 9884121
0
 
LVL 20

Expert Comment

by:jitganguly
ID: 9885058
Why C?
0
 
LVL 11

Author Comment

by:SweatCoder
ID: 9885133
no offense intended. . .

but you just gave me a single link with no explanation. i gave you the points. i feel that an 'A' should go to a carefully constructed and explained answer.

anyway, i had already tried what that link suggests, and maybe i had just implemented it wrong.

i'm not giving the C as a slap in the face, i'm just giving it to reflect the effort required to cut and paste a link, little effort needed.

anyway, the question was simple, and i suppose it warrants a simple answer.

sorry if that bugged you. i guess i should have given an 'A'. my bad. i'll change it if there's a way. I was thinking "C" = Average, not "C" = Crap.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 20

Expert Comment

by:jitganguly
ID: 9885156
If something does not work, you could always ask me. 'C' is an insult to me. Sorry you are balcklisted unless you ask CS to change it http://www.experts-exchange.com/Community_Support/
0
 
LVL 11

Author Comment

by:SweatCoder
ID: 9885191
didn't mean to insult. i'm new at EE so i'm not up on the culture. i'll request to have it changed.
0
 
LVL 20

Expert Comment

by:jitganguly
ID: 9896537
Thank you
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now