Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

A Developer's First Look at Web Parts : Page 3

Microsoft Office SharePoint Portal Server 2003 and Windows SharePoint Services offer an exciting key technology: Web Parts. Creating Web Parts in Visual Studio.NET is about to become one of the most powerful tools in your developer's repertoire.


advertisement
Designing Web Parts with Visual Studio.NET
Figure 6: The Web Part Template installer lets you choose a language.
You can use Visual Studio .NET to build Web Part assemblies for use in SharePoint products and technologies. There are two options for building your Web Parts in Visual Studio: you can use the standard (provided) template for building a Web Control gallery, or you can use a special template and build a Web Part gallery. The Web Part gallery templates are not included with Visual Studio .NET, but you can download them from Microsoft at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnspts/html/sharepoint_webparttemplates.asp. The templates are provided to help you create Web Parts and are very similar to the default server control file and project templates included with Visual Studio .NET. These templates are available for both Visual Basic .NET and C#. You choose the language you want when you run the template's setup program (see Figure 6). Another piece of information you need to supply while installing the templates is the location of the Microsoft.SharePoint.dll file (see Figure 7). On a computer running Windows SharePoint Services, the DLL is stored in local_drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\ISAPI.

Creating a project from the Web Part gallery templates offers advantages and features over using the standard Web Control gallery template, including:

  • An automatic reference to the Microsoft.SharePoint.dll file
  • A Web Part class file and a matching .dwp file
  • A Web Part Manifest.xml file used during installation of the Web Part on the SharePoint server
Figure 7: The Web Part Template installer requires you to enter the location of the Microsoft.SharePoint.dll.
You will find the process of creating a Web Part very familiar if you have ever created an ASP.NET custom control. All the techniques for building an ASP.NET custom control also apply to building a Web Part custom control. The primary difference is that with a Web Part, you inherit from the WebPart class instead of from a WebControl class. You also need to override the RenderWebPart method instead of overriding the RenderContents method.

Additional information regarding developing Web Parts for SharePoint products and technologies is available in the SharePoint Products and Technologies Software Development Kit (SDK) available from MSDN (http://msdn.microsoft.com/sharepoint), and there are additional resources listed in the Related Resources section of this article. Developing Web Parts is definitely not your grandfather's programming. Web Parts mean new opportunities, new horizons, and new challenges for developers providing a revolutionary capability for end users to customize their workspaces.



As always, I'm interested to hear your feedback about the material covered here.



Jim Duffy is founder and president of TakeNote Technologies, an award-winning training and software development company. He has a BS degree in Computer and Information Systems and over 20 years of programming and training experience. Jim is an energetic trainer, skilled developer, and has been published in leading developer-oriented publications. As a Microsoft MVP, Jim is a popular speaker at regional user groups and developer conferences. He is also the co-host of Computers 2K3, a call-in radio show on WRBZ, 850 The Buzz, in Raleigh, NC. Jim is the author of TakeNote's popular VFP database auditing product, FoxAudit. Additional information about Jim and TakeNote Technologies can be found at www.takenote.com. .
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date