views:

233

answers:

1

Hi all,

I'm using the .SiteMap file and Sitemap control to create a sitemap on a page. The title of the page in the Web.sitemap is: "Out & About".

When the page renders, the ampersand is shown as an & (Out & About) in the source, this obviously then causes validation errors.

Any ideas how I can force good ol' .net sitemap to encode the ampersand as I entered it into the title.

As usual, thanks for any help. peteski

+1  A: 

Use HttpUtility.HtmlEncode to encode your text first, this will emit the appropriate entities (in this case "&amps;").

Richard
I don't see how I can do this as the .SiteMap file is XML.
peteski22
You an manually add an extra level of encoding in your file: "amps;"
Richard
This should be marked as a solution since it does work.
Richard Collette