Step 1: Set Up the Project for the Custom Web Part
Note
This topic describes functionality that is part of the Infrastructure Update for Microsoft Office Servers. To download the update, see Description of the SharePoint Server 2007 infrastructure update: July 15, 2008.
This walkthrough describes how you can create the custom federated search Web Part by using Microsoft Visual Studio 2008. Step 1 describes how to set up the project for the Web Part. it includes the following tasks:
Creating the Web Part project
Adding required references to your project
Creating a class file for the Web Part
You can download the complete code for the custom federated search results Web Part sample from the Custom Federated Results Web Part Sample release tab, on the Microsoft Office SharePoint Server 2007 SDK Search Samples resource page of the MSDN Code Gallery.
Procedures
To create the project for the Web Part
In Visual Studio 2008, on the File menu, point to New, and then click Project.
In Project types, under C#, click Web.
Under Templates, click ASP.NET Server Control.
In the Name field, type CustomFederatedResultsSample, and then click OK.
Next, you must add required references to your Web Part project.
To add references to the CustomFederatedResultsSample project
On the Project menu, click Add Reference.
On the .NET tab, select each of the following references, and then (click OK after each selection:
Microsoft Office Server component (Microsoft.Office.Server.dll)
Microsoft Search component (Microsoft.Office.Server.Search.dll)
Windows SharePoint Services (Microsoft.SharePoint.dll)
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
In Solution Explorer, right-click ServerControl1.cs, and then click Delete to remove the default class created with the project.
On the Project menu, click Add New Item.
In Categories, under Visual C# Items, click Web.
In Templates, under Visual Studio installed templates, click ASP.NET Server Control, type PerUserAuthWebPart.cs, and then click Add.
Next Steps
Step 2: Add the Code for the Custom Web Part
Step 3: Deploy the Custom Web Part
See Also
Reference
FormsCredentials
FederatedResultsWebPart
FederatedResultsDatasource
FederatedResultsDatasourceView
SearchResultsBaseWebPart
SearchResultsBaseDatasource
SearchResultsBaseDatasourceView
Concepts
Creating a Custom Federated Search Web Part with a Credentials UI
Federated Search Overview
Building Custom Enterprise Search Web Parts