If you try to add class diagram to Web Site in Visual Studio 2005 and create a diagram of code-behind classes of web controls, the following messages will appear preventing from creating the diagram for such classes:


Visual Studio allows only classes in Add_Code folder and its subfolders added to class diagram and to manipulate such classes. This is a limitation in current release of Visual Studio because development team decided to take an opportunistic approach and limit the functionality of class designer only to static classes, not dynamic classes such as code-behind ones in web site projects.
I created the following sample Web Site project in Visual Studio 2005 and created address control, which consists of the three child controls and controls inherited from ControlBase web user control:

If you try to create a class diagram for these user controls Visual Studio will show previous error messages. The workaround for this limitation is in creating a shadow project and adding a class diagram via links to code-behind files in the original web site project.
Right click on the solution in Solution Explorer and select Add, New Project command from context menu. Select Class Library Template and enter ShadowProject in Name text box and click OK.

This will add a new project ShadowProject in the solution:

Select ShadowProject in the Solution Explorer, right-click on the project name, select Add command, New Item In the Add New Item dialog, then select Class Diagram and click Add button:

This will add a new file with name ClassDiagram1.cd to ShadowProject and IDE will show empty class diagram. To mimic the structure of the web site project, right click on the ShadowProject and select Add, New Folder command and enter Controls in the Name text box and press Enter button. Select folder, which was just created and click Add, Existing Item. Navigate to Web project, open Controls folder and choose all classes which correspond to the existing web controls you want to add to class diagram and click on the arrow in Add button and select Add As Link command from the drop-down menu:

This is a crucial step in creating the class diagram for the code-behind classes such as IDE will add selected files to the shadow project and will keep link to the original files. After this, specified classes will be added to the class diagram as well as the relationships between classes:

Now class diagram can be modified as needed and any changes will be reflected to the original classes and diagram will be always up-to-date. Hope this will help in creating better architecture of your web site.