Nov 30, 2009

How to use SPSWC controls in Sharepoint DataFormWebpart

If you try to add a control such as to a Sharepoint Data View Webpart inside the XSLT, Sharepoint Designer will crash and your page won't render correctly.

You need to add two things to fully register the SPSWC namespace for use in XSLT.

1. Add at the top of your page:

<%@ Register Tagprefix="SPSWC" Namespace="Microsoft.SharePoint.Portal.WebControls" Assembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>


2. In the <xsl:stylesheet> tag at the beginning of your Data View Webpart, add an entry for:
xmlns:SPSWC="Microsoft.SharePoint.Portal.WebControls"


That should do it.

No comments:

Post a Comment