Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6954379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:35:53+00:00 2026-05-27T14:35:53+00:00

I have Url with space and would like to replace spaces with %20(escape them).

  • 0

I have Url with space and would like to replace spaces with %20(escape them). UrlPathEncode should do that but it do not works on url below which has spaces. Can someone explain why it is not working?

System.Web.HttpUtility.UrlPathEncode("http://a1.quickcatchlabs.com/phototemplates/football_blimp_1.html?i_url=http://lh3.ggpht.com/yf5lVBB_WNBvBHT1HoIzY1SG0-PY5zRCobP3vBacuSk9N346F7CeAIRSFOltR6ZC1-yf-MNKAcAd7bAZ_A=s612-c&i_name=Patriots  vs Redskins&i_venue_name=Gillette Stadium &i_venue_address=Foxborough , MA&d_Score_0=34&d_Score_1=27&d_Period_0=Final&p_name_0=Patriots &p_name_1=Redskins");
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:35:54+00:00Added an answer on May 27, 2026 at 2:35 pm

    As the name implies, UrlPathEncode encodes the path. Just the path, not the query portion of the URL. If you add a space to path and run that code again, you will see that the space in the path portion is replaced by a %20, but the spaces in the query portion are not.

    If you replace the call to UrlPathEncode with one to Uri.EscapeUriString, it will correctly encode the entire URL, not just the path.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a regular expression, say /url.com\/([A-Za-z]+)\.html/ , and I would like to replace
I have url http://www.domain.com/folder/?variable=1 i would like to do a mod redirect to index.cfm
I have an url like this: http://www.w3schools.com/PHP/func_string_str_split.asp I want to split that url to
I have a login page that I would like to show in https. After
I have three images that I would like to join in a widget I'm
I have an image I would like to use as a background image but
I have a string representing an URL containing spaces and want to convert it
I have URL like: http://example.com#something , how do I remove #something , without causing
I have URL scheme for my blog like this: http://www.example.com/%YEAR%/%MONTH%/%CATEGORY%/%POST_TITLE%/ Now i want to
I have URL like this: http://localhost/PMApp/temp.htm?ProjectID=462 What I need to do is to get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.