One of the best new features in ASP.NET 2.0 I have seen this week is the new Web Part Framework. I assumed this was only for building SharePoint components. Not at all. This is a very rich tool set of components and controls that allow you to easily build a web portal application. For example, you can allow users to:
- Edit the layout of your page by dragging and dropping Web Parts around on the page
- Add Web Part controls to a page (and restrict which controls are available to add)
- Collapse/Minimize Web Parts
- Remove/Hide Web Parts
- All changes are automatically stored away in the Personalization framework so that they are remembered each time the user returns to your site
Adding the Web Part Framework to your site appears to be extremely easy. There are some base classes you can implement for maximum functionality, but you don't have to. You can take your existing User Controls and drop them on the page inside Web Part containers and the framework will automatically provide a wrapper around your controls.
Another great feature is that Web Parts can communicate with each other. It is possible to allow a user to dynamically add a Web Part to a page and it automatically detect and consume data exposed by one or more other Web Parts on the page.
One thing to note: Not only is SharePoint not required, but Web Parts created in ASP.NET 2.0 are currently not compatible with the current version of SharePoint. The next version of SharePoint will be based on the Web Part framework in ASP.NET 2.0, and there may be a service pack in the meantime to allow 2.0 Web Parts to be used.