Welcome to MSDN Blogs Sign in | Join | Help
Variations requires SharePoint Web Parts

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.

Posted: Thursday, June 18, 2009 5:50 AM by itsmeskv
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

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

Page view tracker