developer.com
Search EarthWeb
CodeGuru | Gamelan | Jars | Wireless | Discussions
Navigate developer.com
Architecture & Design  
Database  
Java
Languages & Tools
Microsoft & .NET
Open Source  
Project Management  
Security  
Techniques  
Voice  
Web Services  
Wireless/Mobile
XML  
New
 
Technology Jobs  

   Developer.com Webcasts:
  The Impact of Coding Standards and Code Reviews

  Project Management for the Developer

  Defining Your Own Software Development Methodology

  more Webcasts...




See The Winners!




Developer Jobs

Be a Commerce Partner














 


Related Article -
ASP.NET 2.0: WebPart Framework Basics
Build a Custom SharePoint Web Service for Your InfoPath 2003 Documents
SharePoint and Web Services
Developer News -
Why Firefox Doesn't Take Google Chrome Features    June 26, 2009
First Major PHP Update in Years Coming Soon    June 25, 2009
Red Hat CEO Calls on Oracle to Keep Java Open    June 25, 2009
Google Widens AdSense for iPhone, Android Apps    June 24, 2009
Free Tech Newsletter -

Write Custom WebParts for SharePoint 2007
By Sahil Malik

Go to page: Prev  1  2  

Using the WebPart

Go to the site of your choice. I created a site called "TestSite" using the Blank Template included in SharePoint. Once at that site, click on Site Actions --> Edit Page as shown below:

Your page will prompt you to add new WebParts as shown below:



Click here for a larger image.

In my case, I have two WebPartZones. Depending upon the template you selected, your exact UI may look different. Click the "Add a WebPart" button on any one of the WebPart zones. You will see the "Add Web Parts" dialog, which simply shows you a list of possible WebParts you could add to your page.

Under Miscellaneous, you should see the SimpleWebPart. Check the checkbox, and click "Add" (see Figure 4).

Figure 4: Add SimpleWebPart

You now should see the WebPart you wrote running under SharePoint, as shown below:



Click here for a larger image.

Now, you can play with this WebPart a bit. Click the "Edit" menu, and select "Modify Shared Web Part" as shown here:

You will notice that an "EditorZone" pops up. Modify the values as shown below:

Figure 5: Modify the SimpleWebPart Values

Click OK, and then click "Exit Edit Mode" on the top, right-hand side of the page (this may be specific to the template your site is based on) as shown here:

You should see your fully customized WebPart running inside MOSS 2007. The following is an action shot of all your hard work:

Congratulations! You have just written a WebPart for MOSS 2007, deployed it, and used it successfully on a SharePoint Web page.

Microsoft Office and SharePoint Server 2007 Integration

This tutorial demonstrated how to write a simple WebPart and then host and use it in MOSS 2007. Your real world applications will probably require more complicated WebParts, but to keep the WebPart simple, the demonstration left out some details. For instance, SharePoint by default comes in a very locked-down, secure mode. When writing WebParts for SharePoint, you need to have a good understanding of how code-access security works.

About the Author

Sahil Malik (www.winsmarts.com) has worked for a number of top-notch clients in Microsoft technologies ranging from DOS to .NET. He is the author of Pro ADO.NET 2.0 and co-author of Pro ADO.NET with VB.NET 1.1. Sahil is currently also working on a multimedia series on ADO.NET 2.0 for Keystone Learning. For his community involvement, contributions, and speaking, he has also been awarded the Microsoft MVP award.

Go to page: Prev  1  2  


Tools:
Add www.developer.com to your favorites
Add www.developer.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed


ASP & ASP.NET Archives






internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs