ASP.NET 2.0 has a lot of great new features. I’ve been working with it for about a year and I’m very impressed with what you can do with Visual Studio 2005 and ASP.NET 2.0.
But…
There is always a ‘but I hate what they did with my…‘ statement isn’t there? I’m not happy with some of the changes. I’ve run into a few annoyances, shook my head at some of the new ‘features’ and ranted about some of the other changes. Today however I’m going to share a tip that I find useful for dealing with the removal of the component tray for ASP.NET 2.0 web pages.
1.x component tray.
In Visual Studio 2002/2003 the Forms designer has a area called the component tray for all non-visual UI components. When you drag a DataSet or SqlConnection to the webform they get added to the component tray.

This is nice because it keeps the components out of your way and doesn’t clutter up the HTML designer or Design view of your form.
Missing in Visual Studio 2005
In Visual Studio 2005 the component tray has vanished in the Webform designer. Now you end up with your non-visible components, like the SqlDataSource, on your page designer.

Tip: Move the components out of your way
I found out that I can put the components in a Panel control and they still work correctly. Then I can move the panel to an out of the way spot on the page. Sort of like making my own component tray.
Steps to reproduce
- Add a panel to your webpage.

- With the panel selected - click the Layout/Position/Relative menu item. This makes the panel drag-able in the form designer.

- Drag the components you want to move to the Panel control.
- Drag the Panel to your desired location.
Comments
2/23/2006 9:23 PM RRS
That’s slick. I never would have thought of that.
3/12/2006 3:50 PM Jason Conway
This method works, in addition to this method, you could also:
Click the "View" menu
Select the "Component Designer"
When the Compent Designer renders on a new tab, right click the Name in the tab and select "New Horizontal Tab Group"
You can then resize and it looks and functions very similarly to the 1.1 Component Tray
3/18/2006 2:24 PM Walt Ritscher - Thinking about code
Jason.
That doesn’t work for me. I get an error -Failed to create component. WebForms toolbox can only be used on Webform pages.
Thanks anyway.