Skip to main content

SharePoint Workshop

Go Search
Home
Thinking In SharePoint
Product Finder
Consultant Finder
About Us
  
SharePoint Workshop > Pages > How To Build Client-Side Web Parts  

How To Build Client-Side Web Parts

There are a number of common web site features that SharePoint doesn't provide out-of-the-box, but are pretty easy to implement on your own. These features are a good starting point for learning how to create custom web parts because they don't require you to master Visual Studio, SharePoint Designer, or any other complex tool. Instead, you can implement them using standard HTML and JavaScript using the Content Editor web part. These parts run primarily on the client -- not the server -- so they don't need to be compiled or installed.
What can you do on the client side? Basically anything that doesn't need to gather or persist data back the server. Here are some practical examples:
  • Automatically refresh a page
  • Redirect from one page to another
  • View and change the CSS styles on a page
  • Display custom navigation components

Here are the basic steps for creating reusable client-side web parts:

  1. Add a Content Editor web part to a page.
  2. Add the custom HTML and JavaScript to the web part.
  3. Test and debug the HTML/JavaScript (FireFox works best for this).
  4. Export the completed web part as a .dwp file.
  5. Import the .dwp into the site collection's web part gallery, or deploy the web part to all site collections using the stsadm -o addwppack command on the server.

You can download some example client-side web parts, along with more complete instructions, by clicking here:

Download Client Side Web Part Samples

Last modified at 9/9/2008 9:35 AM  by Jeff Webb 
Essential SharePoint | Programming Excel | SharePoint Workshop | Using SharePoint | Visual Basic Workshop