Content by Category
.NET 1.x
.NET 2.0
.NET 3.0
.NET 3.5
.NET 4.0
.NET Assemblies
.NET Framework
.NET Getting Started
Accessibility
ADO.NET
Advertorials
Agile Development
AJAX
Architecture
ASP.NET
ASP.NET MVC
ASP.NET WebForms
Azure
B2B (Business Integration)
Bing
BizTalk
Book Excerpts
Build and Deploy
C#
C++
ClickOnce
Cloud Computing
Code Contracts
CODE on the Road!
COM+
Community
Conferences
Continuous Integration
Crystal Reports
CSLA.NET
CSS
Data
Design Patterns
Development Process
Display Technologies
Distributed Computing
DotNetNuke
DSL
Dynamic Programming
Editorials
Enterprise Services ("COM+")
Entity Framework
Events
Expression Blend
F#
Fox to Fox
Frameworks
Functional Programming
Git
Graphics
Internet Explorer 8.0
Interviews
iPhone
Iron Ruby
Java
Java Script
jQuery
LINQ
Linux
Mac OS X
MDX
Microsoft Application Blocks
Microsoft Business Rules Framework
Microsoft Dynamics
Microsoft Expression
Microsoft Office
Mobile Development
Mobile PC
Mono
MsBuild
Network
NHibernate
Object Oriented Development
Odata
Open Source
Opinion
Opinions
Oracle
ORM
Other Languages
Parallel Programming
Patterns
Podcasts
Post Mortem
PowerPoint
Print/Output
Prism
Product News
Product Reviews
Project Management
Python
Q&A
Rails
Rake
Reporting Services
REST
RIA Services
Ruby
Ruby on Rails
Search
Security
Services
SharePoint
Silverlight
SOA
Social Networks
Software & Law
Software Business
Source Control
Speech-Enabled Applications
SQL Server
SQL Server 2000
SQL Server 2005
SQL Server 2008
SQL Server CE/AnyWhere/Mobile/Compact
SSIS
Subversion
Sync Framework
Tablet PC
TDD
Team System
Techniques
Testing and Quality Control
Tips
UI Design
UML
User Groups
VB Script
VB.NET
Version Control
VFP and .NET
VFP and SQL Server
Virtual Earth
Vista
Visual Basic
Visual Basic 6 (and older)
Visual FoxPro
Visual Studio .NET
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Visual Studio Tools for Office
VSX
WCF
Web Development (general)
Web Services
WF
Whitepapers
Windows 7
Windows Azure
Windows Live
Windows Server
Windows Vista
WinForms
Workflow
WPF
XAML
XML
XNA
XSLT



Virtual Brown Bag Lunches


 


DevReach

Reader rating:
Article source: CoDe (2003 - Vol. 1 - Issue 2 - Microsoft Office System )


Article Pages: < Previous - 1 2  3 


A Developer's First Look at Web Parts (Cont.)

Designing Web Parts with Visual Studio.NET

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 they are downloadable from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnspts/html/sharepoint_webparttemplates.asp

"
Using SharePoint and Web Parts, non-programmers can assemble the information they need and control how they want it displayed.
"

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.

Click for a larger version of this image.

Figure 6: The Web Part Template installer lets you choose a language.

Click for a larger version of this image.

Figure 7: The Web Part Template installer requires you to enter the location of the Microsoft.SharePoint.dll.

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

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

Conclusion

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

&


Clint Covington


Lead Program Manager Web Parts SharePoint Products and Technologies Microsoft Corporation

SharePoint Products and Technologies are becoming the center point of the knowledge worker's experience. Using Web Parts, ASP.NET developers can extend everything from enterprise portals to team and personal sites by building reusable components that support personalization. End users can dynamically drag and drip these components into their pages and then set properties that control how content is rendered. Part-to-part connections make it possible for one part to pass data to another part through supporting common interfaces. Developers are going to love the power of Web Parts!



Article Pages: < Previous - 1 2  3 

Page 1: A Developer's First Look at Web Parts
Page 2: Adding a Web Part to a SharePoint Server Portal 2003 Page (cont.)
Page 3: Designing Web Parts with Visual Studio.NET

How would you rate the quality of this article?
1 2 3 4 5
Poor      Outstanding

Tell us why you rated the content this way. (optional)

Average rating:
1.1 out of 5

203 people have rated this article.

      Hacker Halted

 

Devscovery