Reputation: 51
Can some one give me the difference between a SharePoint web part and an ASP.NET web part. I found very little information describing the differences.
Thanks in advance.
Upvotes: 4
Views: 4114
Reputation: 51
As far as i got, SharePoint WebPart overrides ASP.NET WebPart
to to persist its data inside the content database of SharePoint Foundation
you can design for and use an ASP.NET Web Part in SharePoint, but not vice versa.
SPF WebParts supports backward compatibility, cross-page connections, conns between WebParts that are outside of a zone, client-side connections (Web Part Pages Services Component), data caching (incl. to database)
they use differing WebPartManager (e.g. SPWebPartManager) and WebPartZone objects, so you can't easy copy WebParts Pages from ASP.NET to SharePoint, but rather export WebParts
Most of that you find on ...
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.webpart.aspx
http://msdn.microsoft.com/en-us/library/ms415560.aspx
Upvotes: 2
Reputation: 24432
MSDN - Choosing Between ASP.NET 2.0 Web Parts and Windows SharePoint Services 3.0 Web Parts
You should create ASP.NET 2.0 Web Parts whenever you can. However, there are a few exceptions where using SharePoint-based Web Parts might offer advantages.. The following table provides a decision matrix to help you choose the best option depending on your business needs.
Create a custom ASP.NET 2.0 Web Part
For most business needs.
To distribute your Web Part to sites that run ASP.NET 2.0 or SharePoint sites.
When you want to reuse one or more Web Parts created for ASP.NET 2.0 sites on SharePoint sites.
To use data or functionality provided by Windows SharePoint Services 3.0. For example, you are creating a a Web Part that works with site or list data.
Create a SharePoint-based Web Part
When you want to migrate a set of Web Parts using the SharePoint-based Web Part infrastructure to Windows SharePoint Services 3.0.
To create cross page connections.
To create connections between Web Parts that are outside of a Web Part zone.
To work with client-side connections (Web Part Page Services Component).
To use a data-caching infrastructure that allows caching to the content database.
Upvotes: 7