﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0" xml:base="http://smarx.com"><channel><title>smarx.com - developing for the new web</title><link>http://smarx.com</link><description>smarx.com - developing for the new web</description><ttl>5</ttl><item><title>My own MIX'07 video player: using all the new stuff</title><description>&lt;p&gt;I built my own MIX'07 video player last night and recorded a 15 minute screencast to give you an idea of what's possible with all the new releases that came out last week. &lt;a href="http://channel9.msdn.com/Screencasts/330958_MIX07VideosPlayer.wmv"&gt;Here it is&lt;/a&gt;:&lt;/p&gt;&lt;a href="http://channel9.msdn.com/Screencasts/330958_MIX07VideosPlayer.wmv"&gt;&lt;img src="http://smarx.com/images/mix07video_screenshot.jpg"&gt;&lt;/a&gt;  &lt;p&gt;and &lt;a href="http://smarx.com/sample/MIX07VideosCode.zip"&gt;here's the code&lt;/a&gt;.&lt;/p&gt; &lt;h2&gt;Highlights:&lt;/h2&gt; &lt;ul&gt; &lt;li&gt;Searching and paging via ListView, DataPager, and LinqDataSource (all new ASP.NET controls with .NET 3.5).  &lt;li&gt;Video player via the Media control in the ASP.NET Futures July CTP (uses Silverlight 1.0 RC).  &lt;li&gt;Popup biographies and "more/less" collapsible details via the new .NET 3.5-compatible drop of the AJAX Control Toolkit.  &lt;li&gt;Back/forward buttons support via the History control in the ASP.NET Futures July CTP.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Interesting stat: There are more lines of CSS than lines of code in this project.&amp;nbsp;:-)&lt;/p&gt; &lt;h2&gt;Requirements:&lt;/h2&gt; &lt;p&gt;All you need to run the sample is Visual Studio 2008 Beta 2 (I used &lt;a href="http://msdn2.microsoft.com/en-us/express/future/default.aspx"&gt;Visual Web Developer Express&lt;/a&gt;).&lt;/p&gt; &lt;p&gt;I also used the &lt;a href="http://www.asp.net/downloads/futures/"&gt;ASP.NET Futures CTP&lt;/a&gt; and the &lt;a href="http://www.codeplex.com/AtlasControlToolkit/"&gt;AJAX Control Toolkit&lt;/a&gt;, but the necessary binaries for both are included with the code, so you don't need to download those yourself if you just want to run the sample. You'll also need &lt;a href="http://silverlight.net/"&gt;Silverlight 1.0 RC&lt;/a&gt;, but if you don't have it installed, you'll be prompted when you load the app.&lt;/p&gt; &lt;p&gt;Go ahead and grab the database from my sample and build your own MIX'07 video player! I'd love to see what you come up with.&lt;/p&gt;</description><link>http://smarx.com/posts/my-own-mix07-video-player-using-all-the-new-stuff.aspx</link><pubDate>Wed, 01 Aug 2007 16:25:21 GMT</pubDate><dc:creator>Steve Marx</dc:creator></item><item><title>Nikhil's latest photo album up on mixsandbox</title><description>&lt;p&gt;I give &lt;a href="http://nikhilk.net"&gt;Nikhil&lt;/a&gt; a hard time because almost all his demos are some sort of photo album. (It's true.) In spite of that, his demos are always fresh and instructive. His latest is no different. Right now he's demoing it at MIX'07, but you can play with it live at &lt;a href="http://mixer1009.mixsandbox.com/app"&gt;http://mixer1009.mixsandbox.com/app&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;I'm sure he'll blog about the sample soon, but it's interesting just to play with the app. By the way, he'll be showing the live mixsandbox version of the app during his talk, so don't leave any inappropriate comments (yet). :-)&lt;/p&gt;</description><link>http://smarx.com/posts/nikhils-latest-photo-album-up-on-mixsandbox.aspx</link><pubDate>Mon, 30 Apr 2007 23:51:02 GMT</pubDate><dc:creator>Steve Marx</dc:creator></item><item><title>Building a video site with ASP.NET and Silverlight</title><description>&lt;p&gt;Today at &lt;a href="http://visitmix.com/"&gt;MIX'07&lt;/a&gt;, Brad Abrams and others are going to show how to build a video site using &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=9323777E-FE78-430C-AD92-D5BE5B5EAD98&amp;amp;displaylang=en"&gt;ASP.NET Futures&lt;/a&gt;, &lt;a href="http://microsoft.com/silverlight"&gt;Silverlight&lt;/a&gt;, IIS, etc. They'll be showing a number of really impressive demos.&lt;/p&gt; &lt;p&gt;I've been spending the past few weeks writing most of the code for the main application they'll be demoing.&amp;nbsp; (It's one of the reasons I haven't blogged in so long.)&lt;/p&gt; &lt;p&gt;You can now &lt;a href="http://mixer1004.mixsandbox.com/"&gt;see the fruits of our labor&lt;/a&gt; live on the web, thanks to the &lt;a href="http://mixsandbox.com"&gt;MIX Sandbox in the Sky&lt;/a&gt;. The sandbox is a really cool idea that lets all attendees of MIX get their own website to play with and share the things they make.&lt;/p&gt; &lt;p&gt;If you want to see the features of the site, here are some quick steps that will show the highlights of what we built:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Launch &lt;a href="http://mixer1004.mixsandbox.com"&gt;http://mixer1004.mixsandbox.com&lt;/a&gt; in IE7, Firefox, or Safari.  &lt;li&gt;Click the "Next" button below the search results to view the next page. Notice that the URL changes... this is the new &amp;lt;asp:History /&amp;gt; control in action.  &lt;li&gt;Type a search term (try "more", for example), and press "GO".  &lt;li&gt;Now press the back button in the browser, and note that without reloading the whole page, you've returned to page 2 of the original results. Press back again and get to page 1.  &lt;li&gt;Now click on one of the thumbnails to queue up a video in the player. While it's playing, go ahead and queue up another couple videos.  &lt;li&gt;Click the down arrow under the video to drop down the "now playing" list. You should see the videos you queued. If you want, you can drag/drop to reorder them.  &lt;li&gt;Finally, click on the title "fabrikam" in the search results.  &lt;li&gt;This should take you to a Watch page, where you can see the video play. After about 20 seconds, you should see an advertisement show around the video and then disappear again. This is a custom behavior I wrote, backed by a web service, and using XAML animations to do the display.  &lt;li&gt;Finally, go back to the browse page and search for "msslice". Play that video... that one's streaming from &lt;a href="http://silverlight.live.com"&gt;Silverlight Streaming by Windows Live&lt;/a&gt;!&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/brada"&gt;Brad&lt;/a&gt;'s sitting next to me, and he said: "Be sure you say in there something like: There are a bunch more hidden gems, so be sure to come to the talk!" With that in mind, there are a bunch more hidden gems, so be sure to come to his talk. :-)&lt;/p&gt; &lt;p&gt;There &lt;em&gt;really is &lt;/em&gt;a lot more to talk about. In future blog posts, I'll go into some more features of this demo, and I'll share all of the code with you. Also see &lt;a href="http://blogs.msdn.com/brada/archive/2007/04/30/mix-sandbox-in-the-sky-and-my-demo.aspx"&gt;Brad's post about this sample&lt;/a&gt;.&lt;/p&gt;</description><link>http://smarx.com/posts/building-a-video-site-with-asp-net-and-silverlight.aspx</link><pubDate>Mon, 30 Apr 2007 22:10:00 GMT</pubDate><dc:creator>Steve Marx</dc:creator></item><item><title>Microsoft in the OpenAjax Alliance</title><description>&lt;p&gt;Read &lt;a href="http://blogs.msdn.com/brada/archive/2007/03/20/microsoft-joins-the-openajax-alliance.aspx"&gt;Brad's post&lt;/a&gt;&amp;nbsp;about it.&lt;/p&gt; &lt;p&gt;We've been paying a lot of attention to standardization and interoperability with our AJAX framework since the beginning, but I like that we're getting even more involved via the &lt;a href="http://www.openajax.org/"&gt;OpenAjax Alliance&lt;/a&gt;.&lt;/p&gt;</description><link>http://smarx.com/posts/microsoft-in-the-openajax-alliance.aspx</link><pubDate>Wed, 21 Mar 2007 19:45:49 GMT</pubDate><dc:creator>Steve Marx</dc:creator></item><item><title>How to handle a timeout in an async postback</title><description>&lt;p&gt;Web service calls have an easy way to define a timeout handler. (After the actual web service method's parameters, it's the second parameter to the call.)&lt;/p&gt; &lt;p&gt;For async postbacks (UpdatePanels), it's not quite as simple. You need to handle the &lt;a href="http://ajax.asp.net/docs/ClientReference/Sys.WebForms/PageRequestManagerClass/default.aspx"&gt;EndRequest event on the PageRequestManager&lt;/a&gt;. The first parameter to your event handler is a reference to the PageRequestManager itself, but the second parameter is an instance of the &lt;a href="http://ajax.asp.net/docs/ClientReference/Sys.WebForms/EndRequestEventArgsClass/default.aspx"&gt;EndRequestEventArgs class&lt;/a&gt;. When an error occurs, you can use get_error() to take a look at what happened. Here's some code that uses an EndRequest event handler to check for a timeout error and handle it:&lt;/p&gt; &lt;blockquote&gt;&lt;code&gt;&lt;pre&gt;&lt;span style="background: #ffff00"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: #0000ff"&gt;@&lt;/span&gt; &lt;span style="color: #800000"&gt;Page&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Language&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="C#"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;AutoEventWireup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="true"&lt;/span&gt; &lt;span style="background: #ffff00"&gt;%&amp;gt;&lt;/span&gt; 
 
&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="server"&amp;gt;&lt;/span&gt; 
    &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; slow_postback(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, &lt;span style="color: #008080"&gt;EventArgs&lt;/span&gt; e) 
    { 
        &lt;span style="color: #008000"&gt;// ten seconds is overkill... we timeout after one second (see ScriptManager below)&lt;/span&gt; 
        System.Threading.&lt;span style="color: #008080"&gt;Thread&lt;/span&gt;.Sleep(10000); 
    } 
&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; 
 
&amp;lt;!&lt;/span&gt;&lt;span style="color: #800000"&gt;DOCTYPE&lt;/span&gt; &lt;span style="color: #ff0000"&gt;html&lt;/span&gt; &lt;span style="color: #ff0000"&gt;PUBLIC&lt;/span&gt; &lt;span style="color: #0000ff"&gt;"-//W3C//DTD XHTML 1.1//EN"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&amp;gt; 
&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;html&lt;/span&gt; &lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="http://www.w3.org/1999/xhtml"&amp;gt; 
&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;head&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="server"&amp;gt;&lt;/span&gt; 
    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;title&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Handling an async postback timeout&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;title&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; 
&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;head&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; 
&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;body&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; 
    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;form&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="form1"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="server"&amp;gt;&lt;/span&gt; 
        &lt;span style="color: #008000"&gt;&amp;lt;!-- This sets the timeout on async postbacks (i.e. UpdatePanel refreshes) to one second --&amp;gt;&lt;/span&gt; 
        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp&lt;/span&gt;&lt;span style="color: #0000ff"&gt;:&lt;/span&gt;&lt;span style="color: #800000"&gt;ScriptManager&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="ScriptManager1"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="server"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;AsyncPostBackTimeout&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="1"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt; 
        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp&lt;/span&gt;&lt;span style="color: #0000ff"&gt;:&lt;/span&gt;&lt;span style="color: #800000"&gt;UpdatePanel&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="server"&amp;gt;&lt;/span&gt; 
            &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ContentTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; 
                &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp&lt;/span&gt;&lt;span style="color: #0000ff"&gt;:&lt;/span&gt;&lt;span style="color: #800000"&gt;Button&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Button1"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="server"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Fast postback - no timeout"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;br&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt; 
                &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp&lt;/span&gt;&lt;span style="color: #0000ff"&gt;:&lt;/span&gt;&lt;span style="color: #800000"&gt;Button&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Button2"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="server"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Slow postback - times out after one second"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;OnClick&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="slow_postback"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;br&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt; 
                Last updated: &lt;span style="background: #ffff00"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt; &lt;span style="color: #008080"&gt;DateTime&lt;/span&gt;.Now &lt;span style="background: #ffff00"&gt;%&amp;gt;&lt;/span&gt; 
            &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ContentTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; 
        &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;asp&lt;/span&gt;&lt;span style="color: #0000ff"&gt;:&lt;/span&gt;&lt;span style="color: #800000"&gt;UpdatePanel&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; 
    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;form&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; 
&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;body&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; 
 
&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="text/javascript"&amp;gt;&lt;/span&gt; 
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (sender, args) { 
        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (args.get_error() &amp;amp;&amp;amp; args.get_error().name === &lt;span style="color: #800000"&gt;'Sys.WebForms.PageRequestManagerTimeoutException'&lt;/span&gt;) { 
            alert(&lt;span style="color: #800000"&gt;'Caught a timeout!'&lt;/span&gt;); 
            &lt;span style="color: #008000"&gt;// remember to set errorHandled = true to keep from getting a popup from the AJAX library itself&lt;/span&gt; 
            args.set_errorHandled(&lt;span style="color: #0000ff"&gt;true&lt;/span&gt;); 
        } 
    }); 
&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; 
&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;html&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/code&gt;&lt;/blockquote&gt;
&lt;p&gt;That's it! Maybe not immediately obvious, but also not that difficult once you've seen it done. Also note that I'm explicitly setting a one-second timeout for the purposes of this sample. You probably want a longer timeout. (The default is ninety seconds.)&lt;/p&gt;</description><link>http://smarx.com/posts/how-to-handle-a-timeout-in-an-async-postback.aspx</link><pubDate>Thu, 08 Mar 2007 13:38:09 GMT</pubDate><dc:creator>Steve Marx</dc:creator></item><item><title>IntelliSense for ASP.NET AJAX</title><description>&lt;p&gt;The &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=b533619a-0008-4dd6-9ed1-47d482683c78&amp;amp;DisplayLang=en"&gt;March CTP of Visual Studio Orcas&lt;/a&gt; is out, and it includes IntelliSense support for JScript. See &lt;a href="http://blogs.msdn.com/webdevtools/archive/2007/03/02/jscript-intellisense-in-orcas.aspx"&gt;Jeff King's post&lt;/a&gt; about it.&lt;/p&gt; &lt;p&gt;That by itself is cool, but the ASP.NET AJAX support is awesome! It uses the &lt;a href="http://weblogs.asp.net/bleroy/archive/2006/05/01/ScriptDoc_3A00_-document-your-Atlas-classes.aspx"&gt;xml documentation&lt;/a&gt; in the AJAX Library to give you extra information like parameter types/descriptions.&lt;/p&gt; &lt;p&gt;I've seen this before internally, but I haven't gotten a chance to play with it yet. I'm definitely looking forward to it!&lt;/p&gt;</description><link>http://smarx.com/posts/intellisense-for-asp-net-ajax.aspx</link><pubDate>Sat, 03 Mar 2007 00:22:05 GMT</pubDate><dc:creator>Steve Marx</dc:creator></item><item><title>Delayed load with an UpdatePanel</title><description>&lt;p&gt;Improving performance is all about finding and removing bottlenecks. In many web applications, the bottleneck is one slow piece of the page. More specifically, it's the work that happens on the server to enable that one piece that's slowing down the application.&lt;/p&gt; &lt;p&gt;For example, you might have a page that displays an article along with links to related content. The article is quick to load, but those related links require a query across several databases and then an expensive merge step. This means that while your users are sitting at a blank page twiddling their thumbs, the article (which is what they want) is ready to go but stuck on the server waiting for those related links (which they don't yet care about).&lt;/p&gt; &lt;p&gt;This problem leads a lot of ASP.NET AJAX developers to ask how they can use the UpdatePanel to do a delayed load of part of the page. The most common answer I've seen on blogs and on the forums is to use the Timer control set with a short interval. The idea is that you render nothing in the UpdatePanel originally, and then in the timer's OnTick handler, you fill in the missing data.&lt;/p&gt; &lt;p&gt;Here's an example:&lt;/p&gt; &lt;blockquote&gt;&lt;code&gt;&lt;pre&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp&lt;/span&gt;&lt;span style="color: #0000ff"&gt;:&lt;/span&gt;&lt;span style="color: #800000"&gt;UpdatePanel&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="UpdatePanel1"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="server"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;UpdateMode&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Conditional"&amp;gt;&lt;/span&gt; 
    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ContentTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; 
        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp&lt;/span&gt;&lt;span style="color: #0000ff"&gt;:&lt;/span&gt;&lt;span style="color: #800000"&gt;Label&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Label1"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="server"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt; 
        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp&lt;/span&gt;&lt;span style="color: #0000ff"&gt;:&lt;/span&gt;&lt;span style="color: #800000"&gt;Timer&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="timer"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="server"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Interval&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="1"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;OnTick&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="DelayedLoad"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt; 
    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ContentTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; 
&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;asp&lt;/span&gt;&lt;span style="color: #0000ff"&gt;:&lt;/span&gt;&lt;span style="color: #800000"&gt;UpdatePanel&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/code&gt;&lt;/blockquote&gt;
&lt;p&gt;And in the codebehind:&lt;/p&gt;
&lt;blockquote&gt;&lt;code&gt;&lt;pre&gt;&lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; DelayedLoad(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, &lt;span style="color: #008080"&gt;EventArgs&lt;/span&gt; e) 
{ 
    System.Threading.&lt;span style="color: #008080"&gt;Thread&lt;/span&gt;.Sleep(2000); 
    Label1.Text = &lt;span style="color: #800000"&gt;"Stuff that took a long time to load."&lt;/span&gt;; 
    timer.Enabled = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;; 
}&lt;/pre&gt;&lt;/code&gt;&lt;/blockquote&gt;
&lt;p&gt;I believe this is the best solution for most situations. For comparison, here are some other possibilities:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Client-side code that runs via &lt;code&gt;Sys.Application.add_load()&lt;/code&gt; that does &lt;code&gt;__doPostBack(&lt;span style="color: #800000"&gt;'&amp;lt;%= UpdatePanel1.ClientID %&amp;gt;'&lt;/span&gt;)&lt;/code&gt;. Just be careful to remove yourself via &lt;code&gt;Sys.Application.remove_load()&lt;/code&gt; so you don't run again when the async postback finishes. 
&lt;li&gt;Instead of using the timer's OnTick event, do the delayed loading in Page_Load behind an &lt;code&gt;if (IsPostBack)&lt;/code&gt;. This is probably the simplest technique to make sure you're loading the data any time you need it. Just be aware that now on &lt;em&gt;every&lt;/em&gt; async postback on the page, you're going to do the work we already decided was slow. 
&lt;li&gt;Put the contents of that UpdatePanel on another page altogether, and fetch it asynchronously using Sys.Net.WebRequest or a web service call. See &lt;a href="http://weblogs.asp.net/scottgu/archive/2006/10/22/Tip_2F00_Trick_3A00_-Cool-UI-Templating-Technique-to-use-with-ASP.NET-AJAX-for-non_2D00_UpdatePanel-scenarios.aspx"&gt;this post on ScottGu's blog&lt;/a&gt; for an example of how to do this. This is the most efficient solution if the controls are fully decoupled. If the controls do need to be in the same .aspx because they interact (via a trigger, for example) then this won't be an option.&lt;/li&gt;&lt;/ul&gt;</description><link>http://smarx.com/posts/delayed-load-with-an-updatepanel.aspx</link><pubDate>Thu, 01 Mar 2007 06:16:27 GMT</pubDate><dc:creator>Steve Marx</dc:creator></item><item><title>Slides, sample, and code: Achord - collaborative note taking</title><description>&lt;p&gt;Thanks to everyone who came to my webcast today on &lt;a title="Using the Microsoft AJAX Library with PHP" href="http://asp.net/learn/webcasts/view.aspx?tabid=63&amp;amp;id=116"&gt;Using the Microsoft AJAX Library with PHP&lt;/a&gt;. We had about fifty people at the live webcast. If you missed it, a recording should go up in the next 24 hours.&lt;/p&gt; &lt;p&gt;During the talk, I showed how to use the Microsoft AJAX Library to create client-side controls and behaviors. I also showed how to use the networking API (plus "&lt;a href="http://codeplex.com/phpmsajax"&gt;PHP for Microsoft AJAX Library&lt;/a&gt;") to communicate with a PHP server.&lt;/p&gt; &lt;p&gt;The sample I showed during the session is brand new. It's called "Achord", and you can &lt;a href="http://smarx.com/sample/achord"&gt;play with it here&lt;/a&gt;. The idea is for you to be able to write notes during an event (like a webcast!) while seeing the notes other people are taking. Then you can aggregate (copy/paste) when you see something useful. That way not everyone has to type that URL the speaker just mentioned. The name is a play on "accord" and a "chord" (literally, in music, multiple &lt;em&gt;notes&lt;/em&gt; at the same time).&lt;/p&gt; &lt;p&gt;So far it's turned out to be more of a chat application than a collaborative note taking application, but who am I to dictate how it gets used? :-)&lt;/p&gt; &lt;p&gt;Here are the pertinent links:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://smarx.com/sample/achord/PHP and MS AJAX.ppt"&gt;My slide deck from today's webcast&lt;/a&gt;  &lt;li&gt;&lt;a href="http://smarx.com/sample/achord"&gt;The running Achord sample (hosted here with PHP on IIS7/FastCGI)&lt;/a&gt;  &lt;li&gt;&lt;a href="http://smarx.com/sample/achord/achord_sample.zip"&gt;The full working sample code&lt;/a&gt;  &lt;li&gt;Some other URLs I mentioned during the talk:  &lt;ul&gt; &lt;li&gt;&lt;a href="http://ajax.asp.net"&gt;http://ajax.asp.net&lt;/a&gt; - main ASP.NET AJAX site  &lt;li&gt;&lt;a href="http://codeplex.com/phpmsajax"&gt;http://codeplex.com/phpmsajax&lt;/a&gt; - the PHP for Microsoft AJAX Library shared source project (needed to use the web proxies)  &lt;li&gt;&lt;a href="http://projects.nikhilk.net/Projects/WebDevHelper.aspx"&gt;http://projects.nikhilk.net/Projects/WebDevHelper.aspx&lt;/a&gt;&lt;/a&gt; - the tool I used in IE to watch the HTTP traffic&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Enjoy, and let me know what you think!&lt;/p&gt;</description><link>http://smarx.com/posts/slides-sample-and-code-achord-collaborative-note-taking.aspx</link><pubDate>Wed, 28 Feb 2007 23:46:16 GMT</pubDate><dc:creator>Steve Marx</dc:creator></item><item><title>Sys.WebForms.PageRequestManagerParserErrorException - more than just a really long name</title><description>&lt;p&gt;You should already be subscribing to &lt;a href="http://weblogs.asp.net/LeftSlipper/"&gt;Eilon Lipton&lt;/a&gt;, so I don't need to tell you that he has a new post&amp;nbsp;about this&amp;nbsp;lengthy exception called &lt;a href="http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx"&gt;"Sys.WebForms.PageRequestManagerParserErrorException - what it is and how to avoid it&lt;/a&gt;."&lt;/p&gt; &lt;p&gt;It's well worth a read, particularly for those who are porting legacy applications forward to ASP.NET AJAX.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Update: &lt;/strong&gt;It's an unintended humorous consequence that the title of this post can't fit within my blog's layout. :-)&lt;/p&gt;</description><link>http://smarx.com/posts/sys-webforms-pagerequestmanagerparsererrorexception-more-than-just-a-really-long-name.aspx</link><pubDate>Tue, 27 Feb 2007 04:48:07 GMT</pubDate><dc:creator>Steve Marx</dc:creator></item><item><title>PHP and MS AJAX Webcast this Wednesday</title><description>&lt;p&gt;This Wednesday at 1:00PM PST, I'll be presenting a webcast on &lt;a href="http://asp.net/learn/webcasts/view.aspx?tabid=63&amp;amp;id=116"&gt;Using the Microsoft AJAX Library with PHP&lt;/a&gt;. (Drew Robbins was signed up for this one, but he asked me to present because of my CodePlex project: &lt;a href="http://codeplex.com/phpmsajax"&gt;PHP for Microsoft AJAX Library&lt;/a&gt;.)&lt;/p&gt; &lt;p&gt;I'm working between now and then to put together a few new demos, and maybe even ship a couple new features in the CodePlex project. Please register for the event and ask me some hard questions during the session. It would be great to have you there!&lt;/p&gt;</description><link>http://smarx.com/posts/php-and-ms-ajax-webcast-this-wednesday.aspx</link><pubDate>Mon, 26 Feb 2007 13:47:43 GMT</pubDate><dc:creator>Steve Marx</dc:creator></item></channel></rss>