vrijdag 1 april 2011

How to deploy a custom web part in SharePoint 2007

Build you created web part in VS2008. Using Windows Explorer you go to you Debug  or Release map from your project:

… \Documents\Visual Studio 2008\Projects\TestSPWebPart\TestSPWebPart\bin\Debug\

Afterwards you copy the .dll file to the bin map from you SharePoint server (C:\inetpub\wwwroot\wss\VirtualDirectories\80\bin\)

Now you have to open the web.config file (location: C:\inetpub\wwwroot\wss\VirtualDirectories\80\), in that file you have to enter a SafeControl in the correct format,

<SafeControl Assembly="<Assembly name>" Namespace="<namespace of the assembly>" TypeName="*" Safe="True" AllowRemoteDesigner="True"/>

For instance:
<SafeControl Assembly="TestSPWebPart" Namespace="TestSPWebPart" TypeName="*" Safe="True" AllowRemoteDesigner="True"/>

When you have don that you open the root page of your SharePoint site, this is also accessible using localhost. When Internet Explorer opens the page you go to the Site-Actions in the upper right of the corner and open all the Site Settings – afterwards you choose for Web Part under Galleries.

image

There you choose “New”, normally on the bottom of that list you will find your web part, then after you have selected the web part you go back to the top and click “Populate Gallery”.

 

imageimage

After you have populated your gallery of web parts, you can use the web part in a all pages, even in other sites.

Geen opmerkingen:

Een reactie posten