![]() ![]() Web Part Templates for Visual Studio .NET Web Parts are standard ASP.NET custom controls, but Microsoft has provided a new template that simplifies the process of creating Web Parts. You can download the template here . You need to install the template only once, after which it will be available permanently in the Visual Studio .NET environment. Installing the Web Part Template. After downloading the template, locate the file WebPartTemplates.exe, and double click on it to install the templates. The templates support both C# and VB.NET development—choose the target language or languages that fit your requirements. (see Figure 1)
After selecting the Web Parts templates language, you‘ll need to select the location of the Microsoft.SharePoint.dll file. By default, SharePoint installs the Microsoft.SharePoint.dll to local_drive:\Program Files\Common Files\Microsoft Shared\Web server extensions\60\ISAPI; however, you may have installed SharePoint to a non-default location. When you‘re developing locally with Visual Studio .NET, the .NET Framework, and SharePoint installed on same machine, you can simply provide the path to the local copy of the DLL. On the other hand, if you‘re developing on a local machine and connecting to a remote server hosting SharePoint, you‘ll find it easier to copy the DLL to your local machine and use that local DLL location. This article assumes that you‘re developing on a machine with both .NET and SharePoint installed locally (see Figure 2).
After installing the templates, every time you create a new Web Part application, Visual Studio will automatically add a reference to the SharePoint DLL to the Web Part project (see Figure 3).
On the other hand, if you don‘t provide the location for the DLL during installation, VS .NET pops up the following message every time you create a new Web Part application (see Figure 4).
Despite the message text, all that really means is that you‘ll have to add a reference to the DLL manually. |
|