qt8gt0bxhw|20009F4EEE83|RyanMain|subtext_Content|Text|0xfbffd30000000000b100000001000300
I've been spending more and more time developing with .NET 2.0 now that I've got the May community technical preview installed. Chances are that I'll be posting more .NET 2.0 related items as well since that is on my brain. I'll try to keep them to a minimum since I like to keep somewhat of a focus on what is available now, but I'd also like to strees the need to prepare for what is coming. I've always been of the opinion that you need to get into the new technologies as soon as possible, so that you're already an expert by the time the stuff comes out. You know how it goes, you snooze you loose.
There are some really cool changes coming in ASP.NET's web.config files that I am really excited about. I'll just point out a few that I've used (I hate going back to 1.1 because I can't use them). The web.config file in ASP.NET 2.0 allows you to set a lot of things that will apply everywhere in your site. For example, you can tell all pages to inherit from a specific base page class (instead of just using the default System.Web.UI.Page class). Add a pages section and add the pageBaseType, like this:
<system.web>
<!-- ... -->
<pages pageBaseType="MyWeb.UI.MyPageBase" />
<!-- ... -->
</system.web>
Now all pages in my site will inherit from MyWeb.UI.MyPageBase, unless otherwise specified, and I don't have to change the base class on every page I create in the web app. Cool!
You can do the same with your namespace Imports. If you want to import the same set of namespaces on every page, you just add them to an Imports sections under the pages.
<system.web>
<!-- ... -->
<pages>
<imports>
<add namespace="MyWeb.UI" />
</imports>
</pages>
<!-- ... -->
</system.web>
Things are definitely getting cool now. There's a whole lot more in there too (too much to get into here). No more need to register tag prefixes on every page. Now you can add it to the web.config just as we did with namespaces, this time under the registerTagPrefixes section adding the tagPrefix & associated namespace. I just love how things just keep getting smarter. It will only take a few days of using this stuff when Whidbey comes out before we laugh at how we used to have to do that stuff on every page!