Working with ASP.NET 2.0 Web Parts and Windows SharePoint Services 3.0

ASP.NET 2.0 provides a new set of possibilities for SharePoint developers. Jo-Anne West and I were talking about the cool things you can do with Windows SharePoint Services 3.0. Both of us have a background working with ASP.NET and SharePoint Products and technologies, so this is a fascinating topic for us.

We think there's a lot of documentation on the topic in little pieces everywhere, but we were missing an article that compiles the theory, best practices, recommendations, and a real-world code sample. That's how we decided to take the chance, research, and write an article that can help you understand advanced concepts of the ASP.NET Web Part infrastructure and learn how to build custom Web Parts that work in both standard ASP.NET 2.0 and Office SharePoint Server 2007 Web sites. The article also talks about deployment and security settings.

You can find it here:

Working with ASP.NET 2.0 Web Parts and Windows SharePoint Services 3.0

The Windows SharePoint Services 3.0 SDK documentation provides an overview of the Windows SharePoint Services Web Part Infrastructure. However, we wanted to introduce you to the different approaches you can follow to build Web parts for Windows SharePoint Services 3.0.

Our advice: In general, you should create ASP.NET 2.0 Web Parts whenever you can. However, there are a few exceptions where using SharePoint-based Web Parts might offer advantages and the article explores those options.

Also, if you have worked with the ASP.NET 2.0 Web Part framework you possibly know that you can build Web Parts following different approaches. Only one approach will work with WSS 3.0: Create a custom class library project that contains a control that inherits from the System.Web.UI.WebControls.WebParts.WebPart class.

We do a deep dive to the ASP.NET 2.0 Web Part Infrastructure to complement the Windows SharePoint Services 3.0 SDK Web Parts Overview. In ASP.NET 2.0 you need to worry about personalization, while in SharePoint it's built-in for you. We consider relevant to explain the differences and what will work in both worlds.

Show me a cool sample!

If you like Hello World samples, you can find a cool Web Part sample here. For this article, we wanted to provide a walkthrough that goes beyond "Hello World." So we built a sample Web Part that displays driving directions on a Virtual Earth map. You may need driving directions from your home or office. Usually, you select the same start point, so we show you how to create a Start property that you can personalize. The Web part also provides a textbox that allows you to pick a destination and get driving directions in a Virtual Earth map.

This sample shows how you can display custom data in a Web Part. Anything can be done here!