FW: SPS 2003 WebParts vs. ASP.NET 2.0 Webparts
i.e MOSS 2007. This means ASP.NET 2.0 webparts can be used in Sharepoint 2007.
I wont repeat here the steps required to use your ASP.NET 2.0 webpart in Sharepoint 2007. You can see several blogs on this topic like:
http://weblog.vb-tech.com/nick/archive/2006/05/10/1563.aspx
http://msdn2.microsoft.com/en-us/library/ms431087.aspx
One main thing here to be kept in mind while creating custom webparts is that 2003 webparts dwp file uses different schema than Sharepoint 2007 webparts. If you try to use the ASP.NET webpart with old schema and try to import it in sharepoint you get the error:
The class does not derive from the Microsoft.SharePoint.WebPartPages.WebPart class and therefore cannot be
imported or used in a WebPartZone control
To resolve this ASP.NET webparts uses the different schema which is like this:
<?xml version="1.0" encoding="utf-8"?>
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="aspwebpart.FeaturePart, aspwebpart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">FeaturePart</property>
</properties>
</data>
</webPart>
</webParts>
Using this schema you can easily import your ASP.net 2.0 webparts onto sharpeoint 2007.
The custom webparts you create can either be imported from
System.WEb.UI.WebControls.Webparts or Microsoft.Sharepoint.WebPartPages.Webpart
However if you plan to use feature like connections between webparts , you are left with
the option of using only deriving from Microsoft.Sharepoint.WEbPartPages.WebPart.