advertisement
Premier Club Log In/Registration
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   SKILLBUILDING  |   TIP BANK  |   SOURCEBANK  |   FORUMS  |   NEWSLETTERS
Browse DevX
Download the Code for this Article
Are you running SharePoint Portal Server in your organization? Have you developed custom controls for it? Do you use the same process shown in this article? If not, what else do developers need to know? What problems or pitfalls have you discovered while developing or deploying Web Parts? Let us know in the csharp.general discussion group.
Partners & Affiliates
advertisement
advertisement
Average Rating: 4.3/5 | Rate this item | 62 users have rated this item.
 Print Print
 
Developing Web Parts for SharePoint Portal Server 2003 in .NET
This article provides a step-by-step introduction to developing Web Parts using Visual Studio .NET by showing you how to build both simple and complex Web Part components. Along the way, you'll see how to debug Web Parts both locally and remotely—and learn a few tricks and tips. 

advertisement
harePoint allows information workers to create powerful personalized interfaces by simply dragging and dropping pre-defined Web Part Components. Web Parts are components that enable non programmers to gather information they care about and customize the appearance of Web pages. For example, one Web Part might display a user's appointment calendar; another might create a graph showing current sales figures; and a third might show a list of new business topics, each of which functions as a link to a video or audio presentation. Developers can create these Web Part components and make them available to SharePoint users, letting them build customizable pages that meet their needs. This article shows you how to build and consume a simple Web Part.


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)

 
Figure 1: During the Web Part template installation, you can elect to install the templates for either Visual C#, Visual Basic .NET, or both.

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).

 
Figure 2: When asked to specify the Microsoft.SharePoint.dll path, provide the full path, but not the file name.

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).

 
Figure 3: The Solution Explorer in Visual Studio .NET after adding the Microsoft.SharePoint.dll reference.

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).

 
Figure 4: You'll see this message if you don't specify the correct Sharepoing.dll location during installation.

Despite the message text, all that really means is that you'll have to add a reference to the DLL manually.

Page 1 of 6


advertisement
  Next Page: Creating a Simple Web Part in Visual Studio .NET
Page 1: IntroductionPage 4: Creating SafeControls
Page 2: Creating a Simple Web Part in Visual Studio .NETPage 5: Displaying a Web Part in a SharePoint Web Page
Page 3: Web Parts and ASP.NET Custom ControlsPage 6: Debugging Web Parts
advertisement
Advertising Info  |   Member Services  |   Permissions  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About


JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES