Reputation: 1523
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
Upvotes: 1
Views: 559
Reputation: 108975
Use HttpUtility.HtmlEncode
to encode your text first, this will emit the appropriate entities (in this case "&s;
").
Upvotes: 1