Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URL Encoding with c#

Status
Not open for further replies.

mookie

Programmer
May 3, 2000
15
US
I am trying to build a url to access ms exchange, and some of the folder have spaces. I want the string

"BIS QA EDM Calendar"
to become
"BIS%20QA%20EDM%20Calendar"

I see Server.URLEncode(), but that convert spaces to a plus sign, not %20. Java has a nice URLEncoder class that works great. I suppose I could do string.replace to replace spaces with %20, but that leaves open other characters that need encoding. Thanks

Tim

 
I hadn't checked that, but trying it yields the same results

BIS+QA+EDM+Calender

pluses, not the %20 I am looking for.
 
HTMLEncode didn't work either, but you got me looking at the HttpUtillity class, and HttpUtility.URLPathEncode works, thanks for your help.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top