Problem Escaping Spaces in URL in Web.sitemap

  • Thread starter Thread starter Mike McIntyre
  • Start date Start date
M

Mike McIntyre

In a Web.sitemap file I need to include URLs that include spaces. I use %20
to escape the spaces:

<siteMapNode title="Useful Strings" description=""

url="http://getdotnetco.web119.discounta...rticles/A Few Useful String Class Methods.htm">

</siteMapNode>


Even so, I get this error when I include the URLs with the escaped spaces.

Server Error in '/CampaignNavigationControl' Application.

--------------------------------------------------------------------------------

The 'url' property had a malformed URL:
http://getdotnetco.web119.discounta...rticles/A Few Useful String Class Methods.htm.

If I remove all the %20 escapes, I don't get the error - but of course the
URLs no longer work.

Any suggestions?
 
It is invalid to have spaces in a URL. IE can be forgiving of this error,
but still it should be avoided.
 
Thanks Steve.

I know its invalid. But my customer, a fortune 100 company, has spaces in
its URLs and I need to use them in a site map for a intranet site I am
building.

Any workarounds to get the ASP.NET 2.0 site map to accepth them?

--
Mike

Mike McIntyre [MVP]
http://www.getdotnetcode.com
 
Back
Top