Wednesday, October 26, 2011

Strange ampersand from SharePoint 2010

Been noticing on term stores that if you enter an ampersand, SharePoint replaces the "&" with "&". I couldn't see anything different about it when inspecting the HTML or looking at it on Notepad++ with the "show all characters" turned on. So I'm assuming it has to do with different encoding.

It's not recognized as a regular ampersand by Server.HtmlEncode() nor by String.IndexOf().  Ended up doing a specific String.Replace("&","&") on it so the other functions could work with it.

Difficult to Google for "&", but did find some reference to ampersands on SharePoint 2010: Are Ampersands Stored Differently in SharePoint 2010 Than SharePoint 2007?

No comments:

Post a Comment