Solved

URLEncode in asp.net

Posted on 2003-12-05
7
2,014 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 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

13 Experts available now in Live!

Get 1:1 Help Now