I'm adding some custom forms to a list instance by using the <AllUsersWebPart> element in the list schema. It basically configures a WebPart.

My question is, what are all the possible tags I can use in there. What's in the http://schemas.microsoft.com/WebPart/v2 namespace?

There are also variations of this, like http://schemas.microsoft.com/WebPart/v2/ListForm.

Where can I find a reference?


I think it's allways an XML-serialized webpart or something very similar. Look for ListFormWebpart class definition from MSDN:

[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
public sealed class ListFormWebPart : WebPart, IDesignTimeHtmlProvider, IDesignerEventAccessor

Note the namespace. So I think it may be any of webparts in Microsoft.SharePoint.WebPartPages at least (in XML-serialized form). And look at example:

<AllUsersWebPart WebPartZoneID="Right" WebPartOrder="1">
            <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2" xmlns:iwp="http://schemas.microsoft.com/WebPart/v2/Image">
               <Assembly>Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
               <Title>Site Image</Title>

Note "CDATA" - it means that there's no any XML scheme or other way to view a list of all available elements inside AllUsersWebPart tag because there's no such explicit restriction.

  • I figured as much, but something checks for the XML validity (even if inside CDATA). So It must be a schema or some rules somewhere. I can't imagine it just tries to deserialize the XML as a webpart and hope it sticks... – JohnDoDo Feb 10 '12 at 12:46
  • Please examine for example SPSolutionExplorer.GetFilesInFolderTree method. For example, note this line: limitedWebPartManager.ExportWebPart(webPart, (XmlWriter) new XmlTextWriter((TextWriter) stringWriter). The output is used as serialized string. And if you look for details of SPLimitedWebPartManager.ExportWebPart method you'll see - it seems there's no explicit restrictions. I think SHarePoint relies on XML serialization, if it works - OK. So it seems there's no hardcoded range of available elements inside AllUsersWebPart element. – Alex Boev Feb 10 '12 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.