Tech Ed 2005 Day 3 – ASP.NET 2.0: Overview of ASP.NET 2.0

Scott Guthrie gave a session on ASP.NET 2.0. I asked a question about excluding files from a web project, and I got a partial answer. In Beta 2 with source control, the system wants to check in binaries. That is a bug, and he says it will be fixed.


He declared that for Beta 2, all the built-in controls were enhanced with better client-side support for alternate browsers. Whidbey doesn’t require Frontpage server extensions or IIS to function. It includes a built-in development server based on Cassini. When you create a website in VWD2005, it doesn’t auto-generate anything for you. You start out with a blank directory. No WebForm1.aspx.


By default, Whidbey will release with the DOCTYPE set to XHtml transitional. The code editor has intellisense everywhere including css style attributes. The editor will not reformat you code, so that’s a big improvement from v1. It will also preserve your cursor position when you switch between design and html view. Html tags are collapsable now, not just in the code file.


Currently in Beta 2, there is not support for excluding files from a web site. That feature will be added for RTM.


I was impressed with Scott’s demos because instead of doing all the drag and drop with datasets and no domain model, his demoes included a business logic layer, and he chose to ignore the SqlDataSource control in favor for the ObjectDataSource control which binds to his custom domain object. Many demos encourage the wrong way to design applications, but Scott’s didn’t. Bravo.


Toward the end of the first half, he had a VB page, and the VB compiler crashed the IDE. He tried it again. . . .same thing. He switched to a C# page, and he was able to continue. That’s very interesting. I’ll have to try to duplicate that bug. Adding an OutputCache directive to a VB page.


In the afternoon session, Scott covered master pages, navigation controls, themes, membership and roles, and web parts. Scott wrapped it up by going through a localization example. There is a built-in scraper that will find localizeable strings and create the default resource file for you. Then you can create translations, and it’s done. You don’t have to localize every control manually. A “meta” tag in the control controls localization.


All in all, I’m very impressed with the ASP.NET 2.0 feature-set.

Tech Ed 2005 Day 3 – .Net Rocks lunch

Wednesday was a lunch session for a live showing of the .Net Rocks internet radio show.  Carl and Richard hosted some folks from the Teams System group.  There is a lot of interest here at Tech Ed about Team System.  Every session regarding it has been packed.

Tech Ed 2005 Day 3 – ASP.NET 2.0: Under the Covers – Exploring Internals, Page Lifecyle and the Compilation Model

This talk went over the internals of ASP.NET 2.0. Other sessions went over the RAD (*shudders*) capabilities of v2, but this session drills down to the compilation models and other more internal aspects of the runtime. There are several compilation models. One could leave all files on disk and have them autocompiled on demand, or one could compile up front. For pre-compiling, there is the v1.1 option where everything but the markup files are compiled, and then there is full pre-compilation where even the .aspx files are compiled.


V2 also allows for custom build providers. Build providers recognize a particular file type. If you make a custom file extension, the system’s build provider won’t touch the file type it doesn’t know about, but you can specify a build provider that does know what to do with that file type. A build provider provides both design-time intellisense as well as the runtime compilation. The build provider actually uses the CodeDOM to generate a manged class. It also supports receiving a string containing some managed code, but in that case, your build provider would be limited to one syntax.


VirtualPathProvider: This is _huge_ for the URL rewriting crowd. ASP.NET v2 will have a subsystem that will allows virtual directories and pages to be processed more cleanly than with custom HttpModules or HttpHandlers. This is exciting for me because it will help me improve my CMS.


Next, the speaker went over the new parts in the page lifecycle. Here’s the rundown:


OnPreInit: dynamic MasterPageFile, theme
OnPreLoad, OnLoadComplete
InitializeCulture: dynamic culture/UICulture code-gen call when attributes defined.


ASP.NET 2.0 also supports cross-page posts and control post-backs which will only execute a portion of the page lifecycle. When a control does a partial post-back (AJAX-style), the page loads its state and then raises a RaiseCallbackEvent to handle the control functionality. There is also a new mechanism to allow a page to post back to another. The control causing the postback declares a “postbackurl” property that references another page. The page being posted to has to declare the previous page so that the second page can get back to the first one. The mechanics of it load the state of page A and then transfers to page B for the execution. This strikes me as an entry-level feature that ASP 3 developers will love, but having a large number of .aspx files complicates the site when a good amount of logic can be encapsulated in controls.


In ASP.NET 2, the runtime supports an asynchronous page model. This will allow built-in async calls to web services from a page. The page doesn’t block until OnPreRenderComplete. If there is a lot of logic on the page (or called by the page), this can be a good feature.

Tech Ed 2005 Day 2 – Late night geek talk

Tonight after the NHibernate session, which lasted until 10PM, 7 of use went to grab a bite to eat because we hadn’t eaten supper.  We had some pretty good geek talk and some heresy about using DataSets and putting business logic in the UI (I heard arguments _for_ this approach if you can believe it).  Here’s a picture of the table.  It was fun.

Tech Ed 2005 Day 2 – Data Access for Business Objects with NHibernate

Scott Bellware gave a BoF on NHibernate, and while BoF’s aren’t supposed to have media, Scott was able to plug in his laptop and show some NHibernate configuration files and consuming code.  Most in the audience were skeptical about O-R mappers to begin with, and some made objections.  One guy complained that his devs came from a procedural background and don’t know OO that well, so NHibernate doesn’t work for them.  He said it as if that was somebody else’s problem.  I told him that if his devs don’t know OO, then that’s a bigger problem, and everything else is irrelevent. 


I’ve tried out NHibernate, and I intend to incorporate it at some point in my EZWeb CMS.


Caleb Jenkins from INETA helped out with the BoF.

Tech Ed 2005 Day 2 – XSLT2, XQuery, and Saxon.net

Don Demcsak (DonXml) gave a BoF about Xslt2, XQuery and Saxon.net.  He covered what is and what is not included regarding these features in .Net 2.0.  XQuery is included in Yukon, but not the .Net framework 2.0.  This is because the specification has not been ratified, and Microsoft got burned the last time they released something based on an unratified specification with Xsl in IE 5.  Saxon.net seeks to make up for the lack of this feature.