Rounded corners for Web Parts in ASP.NET 2.0
Getting rounded corners on Web Parts in ASP.NET 2.0 isn't a trivial as you might think. It's the web part chrome that renders the border, title bar and other UI elements of all the web parts. To get rounded corners you have to extend both the WebPartZone and WebPartChrome classes to override a few methods and basically add padding to the corners.
While going down this path for a current project, we stumbled upon something that Fredrik Normen put together on GotDotNet called WebPart Components. The library adds rounded corners by doing pretty much the same thing - overriding the CreateWebPartChrome method in WebPartZone and overriding the RenderWebPart method in WebPartChrome. In addition, the library allows you to define templates for each chrome. This library turned out to be a huge time saver and now all that was left to do was to integrate it with ASP.NET AJAX.
In the WebPart Components library we added a reference to the ASP.NET Futures/Preview dll and changed the TemplatedWebPartZone class to inherit from the WebPartZone class in the preview bits.
public class TemplatedWebPartZone : Microsoft.Web.Preview.UI.Controls.WebParts.WebPartZone
That's all we had to do. So, if you're looking to add rounded corners to Web Parts in ASP.NET 2.0, download and take a look at the WebPart Components library. The GotDotNet workspace is here.
