Variations requires SharePoint Web Parts

Published 10 September 07 01:21 PM

These last few days we have become aware of an important limitation regarding variations in SharePoint Server. The thing is that when using variations, web parts need to be inherited from the SharePoint WebPart class (Microsoft.SharePoint.WebPartPages.WebPart) and not from the ASP.NET WebPart class (System.Web.WebControls.WebParts.WebPart). If it is inherited from ASP.NET WebPart class, you will receive an InvalidCastException exception during variation propagation. This occurs when variations tries to cast your Web Part class to Microsoft.SharePoint.WebPartPages.WebPart before calling the PublishingPage.FixWebPartUrlsForVariation() method. I consider this a bug since it could easily be fixed by checking the type before trying to cast.

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# SharePoint 2007 link love 09-13-2007 at Virtual Generations said on September 13, 2007 5:25 PM:

PingBack from http://www.virtual-generations.com/2007/09/13/sharepoint-2007-link-love-09-13-2007/

# SaurabhKV said on June 18, 2009 12:50 AM:

These last few days we have become aware of an important limitation regarding variations in SharePoint

# Kristof Van Gils said on June 24, 2009 9:40 AM:

Is this issue resolved in any updates for SharePoint (WSS3.0 and MOSS2007)?

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required

About Frank Jusnes

Frank Jusnes - Consultant, Microsoft Consulting Services

This Blog

Syndication

Page view tracker