2 out of 3 rated this helpful - Rate this topic

Step 1: Set Up the Project for the Custom Search Web Part

SharePoint 2007

This walkthrough describes how to create the custom Search Web Part using Microsoft Visual Studio 2005. Step 1 describes how to set up the project for the Web Part, and includes the following tasks:

  • Creating the Web Part project

  • Adding the references needed to your project

  • Creating the class file for the Web Part

To create the project for the Web Part

  1. In Visual Studio 2005, on the File menu, point to New, and then click Project.

  2. In Project types, under C#, select Windows.

  3. Under Templates, select Web Control Library.

  4. In the Name field, type SearchBDCWebPart, and then click OK.

Next you must add the required references to your Web Part project.

To add references to the SearchBDCWebPart project

  1. On the Project menu, click Add Reference.

  2. On the .NET tab, select each of the following references, and then click OK after each selection:

    • System.Data

    • System.XML

    • Microsoft.SharePoint

    • Microsoft.Office.Server

    • Microsoft.Office.Server.Search

Before you add code for the Web Part, replace the default class file with a new class file.

To create the class file for the Web Part

  1. In Solution Explorer, right-click WebCustomControl1.cs, and then click Delete to remove the default class created with the project.

  2. On the Project menu, click Add New Item.

  3. In the Add New Item dialog box, click Web Custom Control, type SearchProducts.cs, and then click Add.

See Also

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.