Practical ASP.NET

Visual Studio 2008 and ASP.NET 3.5

Peter shares what he likes -- and doesn't -- in Visual Studio 2008 and ASP.NET 3.5

To be honest, there isn't much for the developer in ASP.NET 3.5. There are lots of goodies in the .NET Framework as a whole (LINQ, for instance) but there's not much aimed at the ASP.NET developer. On the other hand, Visual Studio 2008 has seen a bundle of enhancements that ASP.NET developers will like.

In ASP.NET 3.5, the only new control in the ASP.NET toolbox is the ListView, which is sort of a grown-up version of the old DataList. It repeats rows on the page like a DataGrid but allows you to put your own content in each row, like a FormView. Unfortunately, ListView doesn't have a design surface so you have to work with it in Source view. The SmartTag for the control offers some preset layouts so your best option is to pick a layout in Design view that's close to what you want and then modify the results in Source view.

The ListView doesn't support paging but it can be used with the new DataPager to enable paging. The DataPager lets you separate your paging controls from the ListView itself and provides more customization options than the paging controls built into the 2.0 DataViews. Sadly, the DataPager doesn't appear to work with anything other than the ListView.

Moving to Source View?
As my comment about the lack of a design surface for the ListView suggests, I'm not an HTML kind of guy. I grew up as a coder and that's what I remain. When I need a site to actually look good, I call on people who know more HTML than I do (either Katherine Grace or Russell Sinclair). Not surprisingly, then, I build my pages in Design view with drag-and-drop.

However, I may yet change. When editing an ASPX page, Visual Studio 2008 offers Split view. Split view allows me to simultaneously display a Design view of the page in one pane and a Source view in another pane. Since I can see in the Design view pane the results of my work in the Source view pane, I find that I'm doing more work in Source view.

The major difficulty I have with Split view is that I'm running out of screen space. Using Split view effectively cuts my editing window in half. I've finally gotten myself down to having just one computer and it's a laptop. As a result, the largest screen I'll ever have is 17 inches. So, while I like Split view very much, there are real costs associated with it.

On the other hand, the improved support for CSS in Visual Studio is an almost unalloyed good for a drag-and-drop kind of guy like me. I can now set up the structure of a Master Page using CSS just by dragging my mouse around in Source view (for more on this, see Daniel Moth's video here).

Awkwardness-es
Other changes don't seem to have any upside. I use Master Pages on almost every site that I build. This means that I'm normally dropping new controls into Content controls. In Visual Studio 2008, I'm finding it difficult to drag and drop controls into Content controls because the Content controls seem to wrap themselves very tightly around any controls they already contain. One of the reasons that I'm finding myself using Split view more is because I'm switching to Source view to open up space inside a Content control by adding some carriage returns before the closing </asp:Content> tag.

In Visual Studio 2008, when you select a control it pops up a tab along its top that displays the control's type and Id value (e.g., asp:Button#Button4). While I appreciate not having to look at the Property window to see if I've selected the right thing, quite frankly, these tabs get in the way as much as they help. When I have controls placed close together, the tabs often make it difficult to select the top control.

Would I go back to Visual Studio 2005? No. But it's going to be two or three months before I acquire the "finger knowledge" to be as productive in Visual Studio 2008 as I was in 2005.

About the Author

Peter Vogel is a system architect and principal in PH&V Information Services. PH&V provides full-stack consulting from UX design through object modeling to database design. Peter tweets about his VSM columns with the hashtag #vogelarticles. His blog posts on user experience design can be found at http://blog.learningtree.com/tag/ui/.

comments powered by Disqus

Featured

Subscribe on YouTube