How to: Create a SharePoint Web Part by Using a Designer

A visual web part combines a Web Part item with a User Control item, and you create a visual web part by adding a Visual Web Part item to any SharePoint project. You then design the appearance of the web part by adding controls from the Visual Studio Toolbox to the surface of the user control.

To create a new Visual Web Part project

  1. On the menu bar, choose File, New, Project.

    Note Note

    If your IDE is set to use Visual Basic development settings, open the File menu, and then choose New Project.

    The New Project dialog box opens.

  2. Expand the SharePoint node under either Visual Basic or Visual C#, and then choose the 2010 item.

  3. In the Templates pane, choose the SharePoint 2010 Visual Web Part project template, and then choose the OK button.

    The SharePoint Customization Wizard appears.

  4. On the Specify the site and security level for debugging page, specify the URL of a SharePoint site that’s on the local computer, and then choose the Finish button.

    You’ll test the web part on the site that you specify.

  5. In Solution Explorer, a Web Part item and a User Control item appear.

To add a Visual Web Part to an existing SharePoint project

  1. On the menu bar, choose Project, Add New Item.

  2. Expand the SharePoint node under either Visual Basic or Visual C#, and then choose the 2010 item.

  3. In the Add New Item dialog box, choose Visual Web Part.

  4. In the Name box, specify a name for the web part, and then choose the Add button.

  5. In Solution Explorer, a Web Part item and a User Control item appear.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft