How to customize WSS 3.0 Webpart
Windows Sharepoint Services (WSS) 3.0 is built on top of the ASP.net 2.0, and this provides a great enhancements over ASP.net 1.1.With WSS 2.0. You can now use ASP.net 2.0 to build “IIS web site” in WSS 3.0, which extended with WSS functionality as a web application.
The ASP.net 2.0 Web Part is based on WebPartManager class that manage the lifetime of an instance during runtime. The WSS web part infrastructure uses many controls in ASP.net 2.0. Some of the WSS 3.0 is extended from the base classes that in ASP.net web part control set. It is based on SPWebPartManager that inherits from WebPartManager class.
You cannot simply use the web part on the ASP.net page and use it on the site page in WSS. What you have to do is to export your ASP.net webpart and import into the WSS.
To export an ASP.net 2.0 web part:
1. In your web part code, set the ExportMode property to allow properties to be exported:
this.ExportMode = WebPartExportMode.All;
2. Modify the <system.web> session of your web.config file:
<system.web>
<webparts enableExport="true" />
<sytem.web>
3. In the webpart menu, choose export to create .webpart file.
To import an ASP.net 2.0 webpart into WSS.
1. Place the assembly for your webpart in the bin or global assembly cache
2. Add the web part to the safe controls list in your web.config file
<SafeControl Assembly="MyWebPart" Namespace="MyWebParts" TypeName="*" Safe="True" />
3. In the design mode, select “Add web part” > “Advanced Web Part Gallery and Options”
4. On the “Add Web Part Panel”, select “Import” and browse to your .webpart file.
5. Click upload
6. Drag and drop into your web part zone
When you want to create webparts for WSS 3.0, you can use Web Parts that inherit from System.Web.UI.WebControls.WebParts.WebPart or the Windows SharePoint Services WebPart class.
Here have some links talk on webpart customization:
1. Personalize Your Portal with User Controls and Custom Web Parts
2. Walkthrough: Creating a Basic Web Part
3. Walkthrough: Creating a Basic SharePoint Web Part
4. Walkthrough: Creating Connectable SharePoint Web Parts
And videos demonstrating how to customize web part:
1. Utilize Web Parts and Personalization?
2. Building ASP.NET Web Parts for Windows SharePoint Services 3.0
3. AJAX Enabling ASP.NET 2.0 Web Parts with "Atlas"
Comments
- Anonymous
October 03, 2006
Hmmm..Thank you..quite informative ^^