Using Visual Studio to create a new Web Part project Web Part is one of the most common objects you will create for SharePoint. It is the core base block for platform construction. 1. Open Visual Studio as an administrator and create a blank SharePoint project. Name WroxSPProject and click OK. Deploy as a solution, and click Finish. 2. Right-click and select Add new project Web Part, name it SimpleWebPart, and click Add. 3. Before proceeding, click Generate-deploy solution. At this point, you will find that VS has added many projects to the solution. For example, it adds feature1.feature. The new node SimpleWebPart is also added, which contains many files. Although you cannot see it, many configuration XML files are updated.
If you double-click the feature node, the Feature Designer is opened. It provides a graphical view of the feature that constitutes the current WSP package. And set the deployment level (such as the website or field ). You can add or remove feature from this view. Configure deployment options and edit XML. Because you only add one Web Part, only one feature is displayed.
1. Navigate to SimpleWebPart. webpart and double-click to enter the code view. Modify attributes.
2. Open SimpleWebPart. cs. Modify the code. 3. Deploy the solution. 4. Click View> output. The default generation and deployment steps are displayed. 5. Add the Web Part: Wrox Book Delivery on the Site Page.