Monday, March 1, 2010

SharePoint 2010 Versioned Controls

Title: SharePoint 2010 Versioned Controls

Details: These are the new control tags introduced in SharePoint 2010 that allow us to render code based on specific version ( V3 or V4 ) for the aspx, ascx and master pages. You can use the below tags and code to achieve it. Use the UIVersion attribute to set the version ( 3 for WSS 3.0 and MOSS; 4 for SPF and SPS 2010 )

Code: During Render ( slower )
<SharePoint:VersionedPlaceHolder runat="server" UIVersion="4">
  <div>Your content</div>
</SharePoint:VersionedPlaceHolder>

Code: During Load Time ( faster )
<SharePoint:VersionedContent runat="server" UIVersion="4">
  <ContentTemplate>
    <div>Your content</div>
  </ContentTemplate>
</SharePoint:VersionedContent >

1 comment:

Sandeep K Nahta said...

This control is to support old version