SPC040213: Do not inherit WebParts from Microsoft.SharePoint.WebPartPages.WebPart |
SPC040213: Do not inherit WebParts from Microsoft.SharePoint.WebPartPages.WebPart |
WebParts should be inherited from the ASP.NET Webpart (System.Web.UI.WebControls.WebParts.WebPart). Do not inherit from the SharePoint WebPart.
TypeName: | DoNotInheritWebPartsFromSharePoint |
CheckId: | SPC040213 |
Severity: | CriticalWarning |
Type: | AssemblyFileReference |
Inherit the WebPart from System.Web.UI.WebControls.WebParts.WebPart. This is the recommended way. MSDN states:
When creating new Web Parts, you have the option of creating Web Parts that inherit from System.Web.UI.WebControls.WebParts.WebPart (recommended) or Microsoft.SharePoint.WebPartPages.WebPart. The SharePoint FoundationWebPart class exists primarily for the purpose of backward compatibility and to provide a small set of features that are not available in the System.Web.UI.WebControls.WebParts.WebPart class.
comments powered by Disqus
Copyright © 2013 RENCORE AB. All Rights Reserved
Disclaimer: The views and opinions expressed in this documentation and in SPCAF are those of the creators and do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. All trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners. SharePoint Code Analysis Framework, Version 4.5.2.7855, see www.spcaf.com for more information |