These are Five Benchmarks of Custom Web Parts (From Developer's Guide to Windows SharePoint Services 3.0 ).
1. Compiled : All Web Parts are encapsulated in a compiled DLL
2. Signed : They're signed web part assemblies.
3. Marked as Safe : WSS 3.0 Web app. run only when it's
4. Trusted : WSS 3.0 leverages the Code Access Security (CAS) as same as WSS 2.0
5. Deployed : The Web Part must be on the right place on every Web server in the WSS 3.0 farm.
After you finish creating Custom Web Part, the following steps are used to add your new Custom Web Part into the Web Part Gallery.
- Copy your .dll file to C:\Inetpub\wwwroot\wss\VirtualDirectories\[Your_HostHeader+Your Port]\bin\
- Open web.config of your MOSS server. (It's mostly at C:\Inetpub\wwwroot\wss\VirtualDirectories\[Your_HostHeader+Your Port]\)
- Add new SafeControl of your Web Part in web.config.
Tag: SafeControl
Attribute: Assembly="Your_Web_Part_Assembly_Name, Version=Your_Version, Culture=neutral, PublicKeyToken=Null" Namespace="Your_Namespace" TypeName="*" Safe="True"
Note: If you don't know the assembly name and namespace, you can use the Reflector program to view them. This program is a class browser program. The Reflector program can be downloaded at http://www.aisto.com/Roeder/ - Save web.config.
- Go to Site Setting in MOSS.
- Enter Gallery->Web Parts.
- In Web Part Gallery, click New.
- Select your Web Part. You can change your Web Part file name here if you want.
- Click the Populate button on top of the page.
- Finally, your new custom Web Part will be in the Web Part Gallery, so you can add your Web Part to your Web Part Page.
No comments:
Post a Comment