During the process of developing our new internal Intranet at Ridgian, we’re using gratuitous amounts of HTML 5 and CSS 3.0 in our design. During testing however, we came across this error when attempting to save List Item or Document Properties:
"Namespace prefix 'xsd' is not defined"
It only appeared to happen on a form postback. So after hunting around and finding nothing on this on any of the forums in terms of a workable solution, I decided to work out something for myself.
It was quickly apparent that the issue was due to us changing the metadata tag:
<meta http-equiv="X-UA-Compatible" content="IE=8"/>
to read:
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
which we needed to do in order to get the full goodness of HTML 5.0 and CSS 3.0. I had a dig around the SharePoint code courtesy of .NET Reflector but found nothing I could really use. Bearing in mind that for most users, working with dialog forms which only show standard SharePoint stuff, it doesn’t really matter if the fancy HTML 5.0 stufff doesn’t show when you’re editing the metadata for a list or library item.
So a simple workaround for the problem was to write a User Control to check to see if the current form is in edit mode and if it is switch the metadata tag to IE-8. Here’s the code:
protected override void CreateChildControls()
{
base.CreateChildControls();
// Set the value required normally "IE-9".
RidgianMetaDataTag.Text = @"<meta http-equiv=""X-UA-Compatible"" content=""" + Content + @"""/>";
// Check the editing mode of the form and default back to the Editing mode which is normally "IE-8".
if (SPContext.Current.FormContext.FormMode == SPControlMode.Edit || SPContext.Current.FormContext.FormMode == SPControlMode.New)
{
RidgianMetaDataTag.Text = @"<meta http-equiv=""X-UA-Compatible"" content=""" + EditingContent + @"""/>";
}
}
Seems to work a treat. Now on 17th April 2012, M Oleson created a javascript solution here, which I haven’t tested. Full kudos to him for doing this, it’s an impressive peice of script and please let me know if this works for you. I’m going to stick with my simple work around for the moment though.
Cheers
Dave Mc






Leave a reply to Brian Scott Cancel reply