Month: March 2009

My employer has two web sites: our main one that contains mostly marketing materials, and the support site, which customers must log into and which allows them to download our new software releases, get documentation, and do various other support-related activities. The main site is fairly current in terms of layout and organization, however, the support site is downright ancient. We’ve been planning on unveiling a new one for some time now. The current plan is to build it around Microsoft SharePoint.

I knew very little about SharePoint when I was tasked a week and a half ago to develop a web part that can be used to manage file downloads. I’ve been spending the time reading up on the technology and figuring out the best way of creating a custom web part that will do what we need it to do. So far the results have been both promising and a bit frustrating.

SharePoint itself is interesting, in a ‘wow, you sure can set up a lot of layout and content using just a browser’ kind of way. It also seems like there are 5 different ways to do everything, which is a common trait of Microsoft software. My biggest sore spot is how things are geared towards doing all the development work on the server. I initially though I could set up a server but then do all the coding on my regular XP machine. Sadly, that didn’t fly. I had to load Visual Studio on the virtual Windows 2003 machine I had set up. It all works fine, but it’s a hassle.

My download web part will be based on some existing ASP.NET code I wrote that never went into production. That code features a grid control that shows links with the exact layout and behavior I wanted. I was fearful that I’d have to somehow output all the HTML rendered by the grid, until I realized I can incorporate user controls into a web part. That discovery lead into a whole different set of options: build a web part that loads user controls, or use SmartPart, a web part written by Jan Tielens that makes hosting user controls quick and easy.

I’ve decided to go with the first approach, which is to skip SmartPart and basically mimic its behavior with my own web part. My reasons were twofold: I was pursuaded by articles I read online about the pros and cons of SmartPart, and by the fact that it will give me a chance to really learn the mechanics of writing a custom web part, not to mention allow complete control over everything. At this point I’m trying to figure out the ideal way to pass data from SharePoint to my web part, and then from the web part to my existing user control. The struggle contrinues…

Coding