Step 5: Create a .webpart File for your Web Part

Every Web Part should have a .webpart file, which is an XML file that describes the Web Part. The .webpart file also makes your Web Part appear in the Web Part gallery. This topic explains the easiest way to create a .webpart file.


Step 1: Develop an ASP.NET Web Part Assembly

Step 2: Place your Assembly in the Bin or Global Assembly Cache

Step 3 (Optional): Set Special Security Attributes

Step 4: Add your Web Part to the Safe Controls List

To create a .webpart file

  1. After you have deployed your Web Part and registered it in the Safe Control list, navigate to http://myserver/_layouts/newdwp.aspx, where myserver is the name of the server on which your SharePoint site is deployed.

  2. Select the check box next to MyWebPartLibrary.SimpleFilterConsumerWebPart.

  3. Click Populate Gallery. This will create a .webpart file for the Web Part.

Next Steps

Step 6: Add your Web Part to a Page