| Author: shanmukha kumari 21 Jul 2008 | Member Level: Gold | Rating: Points: 2 |
Please go through the below link to create webparts
http://www.codeguru.com/csharp/.net/net_asp/webforms/article.php/c12293/
|
| Author: Jeyaprakash 06 Aug 2008 | Member Level: Silver | Rating: Points: 6 |
Hi,
Steps to Create and Deploy Class Library Project Webpart
1. Create a Class Library project.
2. Add the following references Microsoft.Sharepoint System.Data System.Web
3. Rename the Project as well as class files.
4. Use the following namespaces in the class file
using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts;
5. Inherit WebPart in the class file
6. Now right click on project file and select properties and select/create strong name.
7. Compile the application.
8. Now find the Assembly (dll) in the bin folder.
9. Move the assembly in to the GAC. GAC availbale in the C:\WINDOWS\assembly path.
10. Add the below code in the web.config for the particular webpage. This code should be placed in the <SafeControls> tag. Right click on the assembly in the GAC to copy PublicKeyToken number.
<SafeControl Assembly="ClassLibrary_WP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=13638a1282740f9f" Namespace="ClassLibrary_WP" TypeName="*" Safe="True" />
11. Use iisreset\ noforce to refresh the web page.
12. Open SPS site, click on site Actions -> Site Settings -> Click on Webparts -> Click New -> Select your webpart
Cheers, Jeyaprakash
|