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

7 responses

  1. I am new to SharePoint 2010. Would you explain in more detail how to implement this?

    Thanks

    1. Hi,

      What you need to do is create a Custom Control in Visual Studio which will be deployed to {14}\TEMPLATES\CONTROLTEMPLATES folder using the code behind I show. The actual ascx file is as simple as:

      Simply add it to the Master page you are using using then @Register directive at the top of the masterpage much like you see others (look at the v4.master if you’re unsure).
      Hope that helps

      Cheers
      Dave Mc

      1. Thanks Dave, Will give this a try tomorrow.

  2. I ended up using Matt Olson’s IE9 javascript fix found at the link below and now site permissions work perfectly!

    http://social.msdn.microsoft.com/Forums/en-SG/sharepoint2010general/thread/8c83010e-d351-48ba-bd1e-1ffb0641ec03

    Thanks again!

  3. I found that even when setting the X-UA-Compatible to IE9 in only non edit mode there were still problems with certain system forms such as the masterpage publish / approval lists.

    The only reliable workaround I’ve found is to conditionally include Pie-JS if the browser is IE in order to bring back the CSS3 features.

    http://css3pie.com/documentation/pie-js/

    1. I tend to agree Brian and I’ve adopted now a similar solution. THanks Dave Mc

Leave a comment

The Blog

Dave Mc muses about history, travel, writing, coaching, astronomy, technology and life, family and the world around us. You may agree with his opinions, you may not, that’s life …