Solved

URLEncode in asp.net

Posted on 2003-12-05
7
2,020 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 AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

778 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