Steve Holstad's "the bright lights"

"Just because your voice reaches halfway around the world doesn't mean you are wiser than when it reached only to the end of the bar." - Edward R. Murrow
in

May 2007 - Posts

Good old blurry pics

Well, that pretty much wraps up MIX 2007. What a great showing by Microsoft. Keeping with Clarity tradition, thought I should throw up a few fuzzy pics:

Mix Main Room screens
Keynote conference layout

Mix Main Room screens
Guitar Hero and Gears of War got a LOT of attention.  Is this the defining geek image of our generation?

Mix Main Room screens
This is your shirt. This is your shirt when you fly Southwest. Any questions?

ASP.NET AJAX Tips & Tricks

My final session of Tuesday was a deep dive on ASP.NET AJAX, with Jeff Prosise, co-founder of Wintellect and Matt Gibbs, Development Manager at Microsoft.

Jeff and Matt did an excellent job of challenging the advanced AJAX guys while still engaging coders with less experience using the ASP.NET AJAX libraries. These two guys seemed to get along really well, and (are you sitting down?) the banter between them was friendly and funny... not that common of a combination from my experience with major conference presentations. The expertise of ASP.NET AJAX they showed by easily handling difficult questions sold me, I'll be checking their blogs from now on.

Code-wise, these two didn't so much deep dive into one particular example, but instead provided "seed" information that I plan to research after the conference. In fact, I left not quite sure what specific points I could write about here, but I am positive that I just accumulated a lot of great tips & tricks that may come up with my clients in the future. A few tips:

  • When using multiple UpdatePanels per page, start getting into the habit of setting the UpdateMode flag to "Conditional". This prevents non-updated panels from sending their contents (viewstate, etc) up the pipe. No need to send this traffic unless the content needs to be updated, right? Keep in mind that with this method, if UpdatePanel A needs to update whenever UpdatePanel C is changed, you'll have to explicitly call UpdatePanel A's Update method in the managed code (example: PanelA.Update();)
  • Immediately go and download Nikhil Kothari's Web Development Helper Utility. What a great tool for watching your asynch postbacks firing client-server: turn logging on and start reducing your traffic size.
  • The ASP.NET AJAX library .pdb files are now available, add 'em to your project to allow debugging into the libraries themselves. Email Matt if you see any bugs.
  • I will forever be stealing the phrase "New it up" to mean instantiating an object. It's stuck in my head forever, much like Bonnie Tyler's "Total Eclipse of the Heart".
  • An UpdatePanel's brain actually lies within the System.WebForms.PageRequestManager class, so take a look at leveraging it's events to manipulate your partial page updates:

    var mgr = System.WebForms.PageRequestManager.getInstance();
    mgr.add_InitializeRequest(InitRequest);

    function InitRequest(sender, args) {
       args.set_Cancel(!confirm('Really postback?'));
    }


    Even though this example isn't very real-world, you could use something like this to prioritize async calls, preventing a more important in-progress request from being cancelled by a subsequent one.  Jeff also used a similar method to draw attention to an updated content area after the asynch postback completed.  Related docs:ASP.NET AJAX PageRequestManager doc
Great job, guys. Turn around, bright eyes...

Silverlight 1.1 .NET & details

I received more detailed info on Silverlight 1.1, here's a quick synopsis:

Silverlight 1.0 provides the core functionality for Microsoft's new cross-browser, cross-platform web presentation plugin. Version 1.1 (now available in Alpha) adds the .NET framework, allowing powerful coding in familiar territory to .NET developers.

  • The Silverlight version of the framework is a trimmed-down, factored subset of the full .NET Framework
  • This refactored framework drops unnecessary parts, such as COM Interop, and provides others on a "pay for play" basis. This allows the Silverlight .NET Framework to be ~4MB, versus the full version's ~50MB.
  • Uses the same tools, APIs and technology as full version, requiring minimal code changes to support both a rich interactive web application and a full desktop implementation of your project
  • Silverlight lives in a sandbox, much like the HTML DOM, which is familiar ground to web developers
  • No way exists to break out of this sandbox, and no permission elevators are provided
  • Safe, isolated storage exists in an obfuscated location, allowing Silverlight to maintain a local storage location on the client machine. Don't forget, all this is CLIENT SIDE execution! The framework is downloaded to the client machine, and what we've thought of as server-side execution now is executing on the client itself. When you hit a breakpoint when debugging, you are attached to the client browser process itself. Any immediate window edits, etc, actually affect the client instance.
  • Client-based file upload controls will allow direct manipulation of files specified by the user on their local disk. The thinking is that if the user specified the file, it is safe for Silverlight to manipulate it.
  • Cross-domain support is in progress
  • 1.1 adds XAML extensibility, Control classes (user controls) and a subset of sample controls
  • Data binding is on the way
  • Only a subset of full WPF, so features such as 3D imaging not available.. these features really require the full hardware processing of a desktop machine to render correctly.

So, what do you need to build and run a Silverlight app? Here are the recommendations for most developers: (all available at http://www.silverlight.net)

  • Silverlight 1.1 Alpha runtime installation
  • Visual Studio Codename "Orcas" Beta 1
  • Silverlight Tools Alpha for Visual Studio Codename "Orcas" Beta 1
  • Expression Blend 2 May Preview
  • ASP.NET Futures

Free Willy 3.5: Visual Studio Codename "Orcas" Preview
I attended Omar Khan's Visual Studio Codename "Orcas" Preview for AJAX Web Development this afternoon, and walked away very excited about getting my hands on it. Unlike the Silverlight alpha & beta previews, which will take nearly a complete paradigm shift by designers and developers to fully appreciate, Orcas appears to be ready to move development teams smoothly into the latest release of .NET 3.5. They've accomplished this by satisfying .NET developers wants, needs & more:

Needs

My #1 ASP.NET IDE complaint is history: Nested Master Pages now render correctly to the design window, instead of the previous IDE approach of "if at first you don't succeed, String.Empty". This will encourage more code reuse by allowing simple usages of multiple master pages for common content.

Comprehensive ASP.NET AJAX 1.0 support: A "huge investment in Javascript tooling for Orcas" is evident by the numerous AJAX Master Page, AJAX form and AJAX control items that are now available as file types you may add to your project. AJAX ojbects are now available within the Orcas toolbox.

This commitment also means that your days of debugging inane client script errors may soon be ending: Impressive context-sensitive Intellisense is now in place for Javascript, including smart discovery of object types (a var assigned to an integer gets numeric Intellisense options, etc). Even your external script libraries are available within Intellisene if linked into the page. And, if script library "A" references second library "B", you'll have Intellisense when editing the library "A" in the IDE; shared libraries are supported throughout a web project in this manner.

One of the coolest features I saw was the ability to comment your javascript and have the information parsed as Intellisense tags. Summary, description, parameter and return values can be specified in the Javascript functions, making client-side coding so much easier. Commenting a return type even explicitly sets the calling code's variable to the specified data type. (I worry this could be error-prone: would err later if function changed but comment didn't?)

SCRIPT DEBUGGING!!! I know that VS 2005 supports client-side debugging, but c'mon, are you really using it? Orcas makes debugging script much more intuitive: when a breakpoint is set on a file, the breakpoint is mapped to the file executing at the browser, giving the effect of direct breakpoint placement. Once you enable script debugging on the browser itself, you're off to the races... I can't WAIT for this one.

Wants

Multi-Targeting: This describes Orcas' complete support of previous .NET framework versions. Simply changes the target platform property, and the IDE configures itself to completely work within the desired version. Sounds simple, but it's a big deal: Target .NET 3.5 and projects reference the System.Core and System.Web.Expressions namespaces required by the latest technologies. Change to .NET 2.0 and the references are gone, the project type dialogs no longer contain > 2.0 project types, the compilers move to 2.0, config files are immediatley rewritten for compliance, etc. This is ideal for project teams that are currently supporting previous .NET projects in 1.1 or 2.0, but still want to move forward with development in 3.5. We can have the best of both worlds.

Linq To Sql File: .dbml file types can be used to create Linq data context objects, which allow direct querying of a SQL database. This gives you strongly-typed, object- relational data objects for direct data access. Admittedly, I am a newbie to LINQ, but I have some serious doubts about this type of tool... sounds great, but in these demos they rarely discuss the issues that tend to trip us up: Error handling, paging, caching, validation, saving back to database, etc.

Whoa, nice

Integrated CSS tools, including the ability to use split views (markup & design view); a CSS properties window which also identifies every element or class a particular object's current styling is deriving from (sweet); design view adjustment of margins & sizing; the ability to create new style classes within the IDE and drag/drop them immediately into your external, linked CSS files; the really handy ability to adjust margin, sizes, etc within the VS IDE design view, while your changes are applied directly to the current CSS file(s).

I'm sure the team at Clarity will be posting more and more about Orcas as we continue to explore all of the new features... for now, I'm considering it a "Krill-er App"... sorry, just couldn't resist that.