Three Requests for ASP.NET 4 and VS 2010

Date Published: 16 March 2008

Three Requests for ASP.NET 4 and VS 2010

I have three things that have been on my wish list for ASP.NET and/or Visual Studio that I’m curious to know what others think. I’ve mentioned some of these before on my blog or elsewhere – they’re not exactly earth shattering and I’m not saying that I want them more than any other feature they might add. But each one would make my life at least a little bit easier, if they were included by default.

So, in no particular order, here they are:

Support For Generics in ASPX Markup

Eilon posted not too long ago about this topic. The idea here is that you should be able to write controls that take advantage of generics, and be able to declaratively specify them within your ASPX/ASCX markup. This would allow for things like strongly typed DropDownList controls or even TextBoxes, and would also allow for MVC views to specify their ViewDataType without having to resort to code. In the WPF world, I understand that this can be done by using the x:TypeArguments attribute. As Silverlight 2.0 takes off, it would be great to see support for generics in its XAML markup, as well. Limiting the discussion to ASP.NET for the moment, what should the markup look like? Mikhail Arkhipov discussed some of the options and challenges 4 years ago, and apparently the solution was not trivial or I have to believe we would already have it. However, I have confidence in the ASP.NET team’s ability to figure this one out.

Save VS Preferences in the cloud

Since VS 2005 we’ve been able to save out our VS preferences to disk and then import them. This is a great feature that I’ve never used – I just usually don’t have access to my primary dev machine when I sit down at another one, and if it’s a coworker’s machine I don’t want to mess with their settings. With things like pair programming, it can be tough to use customized settings since there is no easy way to swap back and forth depending on who’s at the controls. What I would like to see is a way to recover my settings from “the cloud” so that I can get them anywhere I go via my Live ID or OpenID or whatever. Having a quick way to switch between a couple of these would make the pair programming scenario even better. I suggested this four years ago, and I still want it. Another option that might help this situation is being able to run VS from a USB drive, so that it’s completely portable. This would be cool for the “walk up to any machine” scenario but a bit less useful in the pair programming scenario. I’d go for both. The other thing I think would be invaluable for the service method is that Microsoft would be able to mine data about users’ preferences (with opt-in for the privacy paranoiacs) so that their future versions of Visual Studio would ship with defaults that were informed by thousands of real world users’ preferences.

Recursive FindControl

Do a quick search for this and you’ll find a number of similar implementations. This generic recursive findcontrol looks like a pretty good one, based on some code from Palermo and myself. Basically, these let you get a reference to a control even if it is not in the current control’s Controls collection. This happens quite often with templated controls like CreateUserWizard or LoginView or MultiView, and having a recursive findcontrol is quite a bit more flexible than hardcoding the name with $ etc (see tip 4 here). Since I found the need for this technique, I’ve been adding it to my Base Page class or common class in every ASP.NET project I work on, so it seems to me it should really be built into the framework.

Steve Smith

About Ardalis

Software Engineer

Steve is an experienced software architect and trainer, focusing currently on ASP.NET Core and Domain-Driven Design.


Ardalis

Copyright © 2020