People Search Box error in SharePoint Designer

I ran into this error message and it took me a while to solve the mystery:
Unknown server tag 'SPSWC:PeopleSearchBoxEx'
It occurred when I inserted a People Search Box web part to a page in SharePoint Designer. I noticed it happened only when the People Search Box was inserted to a page that already had a Search Box web part.

Here's what happens:
When you insert a Search Box to a new page SharePoint Designer creates it with the SPSWC prefix (SPSWC:SearchBoxEx) and registers this assembly:
<%@ Register tagprefix="SPSWC" namespace="Microsoft.SharePoint.Portal.WebControls" assembly="Microsoft.Office.Server.Search, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
When you insert a People Search Box to a new page SharePoint Designer creates it with the same SPSWC prefix (SPSWC:SearchBoxEx) but registers another assembly:
<%@ Register tagprefix="SPSWC" namespace="Microsoft.SharePoint.Portal.WebControls" assembly="Microsoft.Sharepoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

When you insert either of these web parts, if the other one already exists then the prefix is already registered and won't get registered again. The Search Box can function with either assembly but the People Search Box needs Microsoft.Sharepoint.Portal. The solution is to change the prefix of one of the web parts and register both assemblies accordingly.

For example:
  • WP1:PeopleSearchBoxEx → <%@ Register tagprefix="WP1" namespace="Microsoft.SharePoint.Portal.WebControls" assembly="Microsoft.Sharepoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
  • SPSWC:SearchBoxEx → <%@ Register tagprefix="SPSWC" namespace="Microsoft.SharePoint.Portal.WebControls" assembly="Microsoft.Office.Server.Search, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

Print Friendly and PDF

2 comments:

iuli said...

Nice

DuyMinh said...

Good experience!!

Post a Comment