<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Damian&#039;s Blog &#187; AJAX</title>
	<atom:link href="http://damianblog.com/category/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://damianblog.com</link>
	<description>.NET from Geneva, Switzerland</description>
	<lastBuildDate>Fri, 30 Sep 2011 23:25:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ASP.NET MVC with the AJAX Control Toolkit: automatically getting control dependencies</title>
		<link>http://damianblog.com/2008/10/22/mvc-control-toolkit-dependencies/</link>
		<comments>http://damianblog.com/2008/10/22/mvc-control-toolkit-dependencies/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 16:12:18 +0000</pubDate>
		<dc:creator>dmehers</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://damianblog.com/2008/10/22/aspnet-mvc-with-the-ajax-control-toolkit-automatically-getting-control-dependencies/</guid>
		<description><![CDATA[[Edited 23rd Oct to compress returned JavaScript] I recently wrote a blog post showing how you can use controls from the AJAX Control Toolkit in ASP.NET MVC applications, specifically the ListSearchExtender.&#160; Stephen Walther also wrote one on using the Calendar control here. One thing that bugged me was that it was painful to find out [...]]]></description>
			<content:encoded><![CDATA[<p>[Edited 23rd Oct to compress returned JavaScript]</p>
<p>I recently wrote a <a href="http://damianblog.com/2008/09/07/using-aspnet-mvc-and-the-ajax-control-toolkit/">blog post</a> showing how you can use controls from the AJAX Control Toolkit in ASP.NET MVC applications, specifically the ListSearchExtender.&#160; Stephen Walther also wrote one on using the Calendar control <a href="http://weblogs.asp.net/stephenwalther/archive/2008/08/22/asp-net-mvc-tip-36-create-a-popup-calendar-helper.aspx">here</a>.</p>
<p>One thing that bugged me was that it was painful to find out what scripts a particular control depended on, so that they could be included in the JavaScript used to initialize a control.</p>
<p>I decided to create a simple MVC Controller/View that would return back all the JavaScript required for any particular ASP.NET AJAX Control Toolkit control.</p>
<p>This is the old code for using the ListSearchExtender in an ASP.NET MVC View:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 500px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; height: 426px; background-color: #f4f4f4">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; height: 240px; background-color: #f4f4f4; border-bottom-style: none">&lt;select id=<span style="color: #006080">&quot;Countries&quot;</span>&gt;
    &lt;option&gt;Switzerland&lt;/option&gt;
    &lt;option&gt;United Kindom&lt;/option&gt;
    &lt;option&gt;United States&lt;/option&gt;
&lt;/select&gt;

&lt;script src=<span style="color: #006080">&quot;/Scripts/MicrosoftAjax.debug.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
&lt;script src=<span style="color: #006080">&quot;/Scripts/AjaxControlToolkit.Common.Common.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
&lt;script src=<span style="color: #006080">&quot;/Scripts/AjaxControlToolkit.ExtenderBase.BaseScripts.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
&lt;script src=<span style="color: #006080">&quot;/Scripts/AjaxControlToolkit.DynamicPopulate.DynamicPopulateBehavior.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
&lt;script src=<span style="color: #006080">&quot;/Scripts/AjaxControlToolkit.Compat.Timer.Timer.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
&lt;script src=<span style="color: #006080">&quot;/Scripts/AjaxControlToolkit.Animation.Animations.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
&lt;script src=<span style="color: #006080">&quot;/Scripts/AjaxControlToolkit.Animation.AnimationBehavior.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
&lt;script src=<span style="color: #006080">&quot;/Scripts/AjaxControlToolkit.PopupExtender.PopupBehavior.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
&lt;script src=<span style="color: #006080">&quot;/Scripts/AjaxControlToolkit.PopupControl.PopupControlBehavior.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
&lt;script src=<span style="color: #006080">&quot;/Scripts/AjaxControlToolkit.ListSearch.ListSearchBehavior.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;

&lt;script type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;
Sys.Application.initialize();
Sys.Application.add_init(<span style="color: #0000ff">function</span>() {
    $create(AjaxControlToolkit.ListSearchBehavior,
        { <span style="color: #006080">&quot;id&quot;</span>: <span style="color: #006080">&quot;ListBox1_ListSearchExtender&quot;</span> },
        <span style="color: #0000ff">null</span>, <span style="color: #0000ff">null</span>, $get(<span style="color: #006080">&quot;Countries&quot;</span>));
});
&lt;/script&gt;</pre>
</div>
<p>This is the new code to pull in the dependencies:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 500px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; height: 323px; background-color: #f4f4f4">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; height: 304px; background-color: #f4f4f4; border-bottom-style: none">&lt;select id=<span style="color: #006080">&quot;Countries&quot;</span>&gt;
    &lt;option&gt;Switzerland&lt;/option&gt;
    &lt;option&gt;United Kindom&lt;/option&gt;
    &lt;option&gt;United States&lt;/option&gt;
&lt;/select&gt;

<strong>&lt;script src=<span style="color: #006080">&quot;/ControlDependencies/Get?extenderTypeName=AjaxControlToolkit.ListSearchExtender&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
</strong>
&lt;script type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;
Sys.Application.initialize();
Sys.Application.add_init(<span style="color: #0000ff">function</span>() {
    $create(AjaxControlToolkit.ListSearchBehavior,
        { <span style="color: #006080">&quot;id&quot;</span>: <span style="color: #006080">&quot;ListBox1_ListSearchExtender&quot;</span> },
        <span style="color: #0000ff">null</span>, <span style="color: #0000ff">null</span>, $get(<span style="color: #006080">&quot;Countries&quot;</span>));
});
&lt;/script&gt;</pre>
</div>
<p>You'll see that all the individual script includes have been replaced by a single call to the Get action on the <strong>ControlDependencies</strong> controller. </p>
<p>This is the source to the controller:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 2000px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">using</span> System;
<span style="color: #0000ff">using</span> System.Collections.Generic;
<span style="color: #0000ff">using</span> System.Reflection;
<span style="color: #0000ff">using</span> System.Web.Mvc;
<span style="color: #0000ff">using</span> AjaxControlToolkit;

<span style="color: #0000ff">namespace</span> TestDependencies.Controllers {
<span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> ControlDependenciesController : Controller {
    <span style="color: #0000ff">readonly</span> Assembly toolkitAssembly =
        <span style="color: #0000ff">typeof</span>(AjaxControlToolkit.Utility).Assembly;

    [OutputCache(VaryByParam = <span style="color: #006080">&quot;extenderTypeName&quot;</span>,
                 Duration = 86400,  <span style="color: #008000">// One day</span>
                 Location = System.Web.UI.OutputCacheLocation.Client)]
    <span style="color: #0000ff">public</span> ActionResult Get(<span style="color: #0000ff">string</span> extenderTypeName) {

        <span style="color: #0000ff">if</span> (<span style="color: #0000ff">string</span>.IsNullOrEmpty(extenderTypeName)) {
            <span style="color: #0000ff">return</span> <span style="color: #0000ff">new</span> EmptyResult();
        }

        <span style="color: #008000">// Get the type representing the extender we are handling</span>
        Type extenderType = toolkitAssembly.GetType(extenderTypeName,
                                                    <span style="color: #0000ff">false</span>);
        <span style="color: #0000ff">if</span>(extenderType == <span style="color: #0000ff">null</span>) {
            <span style="color: #0000ff">return</span> <span style="color: #0000ff">new</span> EmptyResult();
        }

        <span style="color: #008000">// What other extenders does this one depend on?</span>
        Stack&lt;Type&gt; dependencies = <span style="color: #0000ff">new</span> Stack&lt;Type&gt;();
        AddDependencies(extenderType, dependencies);

        <span style="color: #008000">// What scripts do those extenders require?</span>
        List&lt;<span style="color: #0000ff">string</span>&gt; scriptsToInclude = <span style="color: #0000ff">new</span> List&lt;<span style="color: #0000ff">string</span>&gt;();
        GetDependencyScripts(dependencies, scriptsToInclude);

        <span style="color: #0000ff">return</span> PartialView(scriptsToInclude);
    }

    <span style="color: #008000">// Find the types that the specified extender type depends on</span>
    <span style="color: #0000ff">static</span> <span style="color: #0000ff">void</span> AddDependencies(Type extenderType,
                                Stack&lt;Type&gt; dependencies) {
        dependencies.Push(extenderType);
        Attribute[] attributes =
            Attribute.GetCustomAttributes(extenderType,
                      <span style="color: #0000ff">typeof</span>(RequiredScriptAttribute));

        <span style="color: #0000ff">foreach</span> (RequiredScriptAttribute attribute <span style="color: #0000ff">in</span> attributes) {
            AddDependencies(attribute.ExtenderType, dependencies);
        }
    }

    <span style="color: #008000">// Find the scripts used by the specified extender types</span>
    <span style="color: #0000ff">static</span> <span style="color: #0000ff">void</span> GetDependencyScripts(IEnumerable&lt;Type&gt; dependencies,
                                     ICollection&lt;<span style="color: #0000ff">string</span>&gt; scripts) {
        <span style="color: #0000ff">foreach</span> (Type dependency <span style="color: #0000ff">in</span> dependencies) {
            Attribute[] attributes =
                Attribute.GetCustomAttributes(dependency,
                           <span style="color: #0000ff">typeof</span>(ClientScriptResourceAttribute));

            <span style="color: #0000ff">foreach</span> (ClientScriptResourceAttribute attribute <span style="color: #0000ff">in</span> attributes) {
                <span style="color: #0000ff">if</span> (!scripts.Contains(attribute.ResourcePath)) {
                    scripts.Add(attribute.ResourcePath);
                }
            }
        }
    }
}
}</pre>
</div>
<p>The View is a User Control that simply outputs all of the required scripts.&#160; This is the code-behind:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 2500px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">using</span> System;
<span style="color: #0000ff">using</span> System.Collections.Generic;
<span style="color: #0000ff">using</span> System.IO;
<span style="color: #0000ff">using</span> System.IO.Compression;
<span style="color: #0000ff">using</span> System.Web.Mvc;

<span style="color: #0000ff">namespace</span> TestDependencies.Views.ControlDependencies {
  <span style="color: #0000ff">public</span> <span style="color: #0000ff">partial</span> <span style="color: #0000ff">class</span> Get : ViewUserControl&lt;List&lt;<span style="color: #0000ff">string</span>&gt;&gt; {

    <span style="color: #0000ff">protected</span> <span style="color: #0000ff">void</span> Page_Load(<span style="color: #0000ff">object</span> sender, EventArgs e) {
      Response.ContentType = <span style="color: #006080">&quot;application/x-javascript&quot;</span>;

      <span style="color: #008000">// Get compressed stream if possible</span>
      Stream outputStream = GetOutputStream();

      <span style="color: #0000ff">using</span>(StreamWriter outputWriter = <span style="color: #0000ff">new</span> StreamWriter(outputStream)) {

        <span style="color: #008000">// Standard AJAX library</span>
        <span style="color: #0000ff">string</span> script = File.ReadAllText(
                              MapPath(<span style="color: #006080">&quot;/Scripts/MicrosoftAjax.js&quot;</span>));
        outputWriter.WriteLine(script);

        <span style="color: #008000">// Required scripts</span>
        <span style="color: #0000ff">foreach</span>(<span style="color: #0000ff">string</span> scriptPath <span style="color: #0000ff">in</span> ViewData.Model) {
          script = File.ReadAllText(MapPath(<span style="color: #006080">&quot;/Scripts/&quot;</span> + scriptPath));
          outputWriter.WriteLine(script);
        }

      }
      Response.End();
    }

    <span style="color: #008000">// Compress scripts if possible -- stolen from ToolkitScriptManager</span>
    <span style="color: #008000">// in AJAX Control Toolkit</span>
    <span style="color: #0000ff">private</span> Stream GetOutputStream() {
      Stream outputStream = Response.OutputStream;
      <span style="color: #0000ff">if</span>(!Request.Browser.IsBrowser(<span style="color: #006080">&quot;IE&quot;</span>) ||
                         (6 &lt; Request.Browser.MajorVersion)) {
        <span style="color: #0000ff">foreach</span>(
          <span style="color: #0000ff">string</span> acceptEncoding <span style="color: #0000ff">in</span> (Request.Headers[<span style="color: #006080">&quot;Accept-Encoding&quot;</span>] ??
                                       <span style="color: #006080">&quot;&quot;</span>).ToUpperInvariant().Split(<span style="color: #006080">','</span>)) {
          <span style="color: #0000ff">if</span>(<span style="color: #006080">&quot;GZIP&quot;</span> == acceptEncoding) {
            Response.AddHeader(<span style="color: #006080">&quot;Content-encoding&quot;</span>, <span style="color: #006080">&quot;gzip&quot;</span>);
            outputStream = <span style="color: #0000ff">new</span> GZipStream(outputStream,
                                          CompressionMode.Compress);
            <span style="color: #0000ff">break</span>;
          }
          <span style="color: #0000ff">if</span>(<span style="color: #006080">&quot;DEFLATE&quot;</span> == acceptEncoding) {
            Response.AddHeader(<span style="color: #006080">&quot;Content-encoding&quot;</span>, <span style="color: #006080">&quot;deflate&quot;</span>);
            outputStream = <span style="color: #0000ff">new</span> DeflateStream(outputStream,
                                             CompressionMode.Compress);
            <span style="color: #0000ff">break</span>;
          }
        }
      }
      <span style="color: #0000ff">return</span> outputStream;
    }
  }
}</pre>
</div>
<p>The ASCX is empty:</p>
<div style="padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 1000px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; height: 42px; background-color: #f4f4f4">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&lt;%@ Control Language=<span style="color: #006080">&quot;C#&quot;</span> AutoEventWireup=<span style="color: #006080">&quot;true&quot;</span> CodeBehind=<span style="color: #006080">&quot;Get.ascx.cs&quot;</span> Inherits=<span style="color: #006080">&quot;TestDependencies.Views.ControlDependencies.Get&quot;</span>  %&gt;</pre>
</div>
<p>There are two advantages to using this technique.&#160; Firstly performance should be increased since all the required scripts are returned in a single response.&#160; Secondly you don't have to manually work out the dependencies for a particular ASP.NET AJAX Control Toolkit control.</p>
]]></content:encoded>
			<wfw:commentRss>http://damianblog.com/2008/10/22/mvc-control-toolkit-dependencies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using ASP.NET MVC and the AJAX Control Toolkit</title>
		<link>http://damianblog.com/2008/09/07/using-aspnet-mvc-and-the-ajax-control-toolkit/</link>
		<comments>http://damianblog.com/2008/09/07/using-aspnet-mvc-and-the-ajax-control-toolkit/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 12:27:43 +0000</pubDate>
		<dc:creator>dmehers</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://damianblog.com/2008/09/07/using-aspnet-mvc-and-the-ajax-control-toolkit/</guid>
		<description><![CDATA[There are a whole range of useful AJAX behaviors available in the ASP.NET AJAX Control Toolkit, and it would be cool to be able to use them from ASP.NET MVC.&#160; In this post I'll show you how you can use one of the extenders that I created, the ListSearch Extender, with ASP.NET MVC. Set up [...]]]></description>
			<content:encoded><![CDATA[<p>There are a whole range of useful AJAX behaviors available in the ASP.NET AJAX Control Toolkit, and it would be cool to be able to use them from ASP.NET MVC.&#160; </p>
<p>In this post I'll show you how you can use one of the extenders that I created, the <a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ListSearch/ListSearch.aspx">ListSearch Extender</a>, with ASP.NET MVC.</p>
<h2>Set up your ASP.NET MVC Project</h2>
<p>To start create a new ASP.NET MVC project.</p>
<p>Next download the <a href="http://www.asp.net/ajax/downloads/library/">Microsoft AJAX Library</a>, which contains the Javascript library used in the Microsoft ASP.NET AJAX implementation. Copy the <em>MicrosoftAjaxLibrary</em> folder in the ZIP you downloaded to the <em>Content</em> folder in your MVC project.</p>
<p>Now download the <strong>Script Only Files</strong> from the <a href="http://www.codeplex.com/AjaxControlToolkit/Release/ProjectReleases.aspx">ASP.NET AJAX Control Toolkit</a> and copy the <em>AjaxControlToolkit</em> folder in the ZIP to the <em>Content</em> f0lder in your MVC project.</p>
<p>Now that the folders are copied you need to make them visible to the project.&#160; Open the <em>Content</em> branch of your project in the Solution Explorer, and then click on the <em>Show All Files</em> button:</p>
<p><a href="http://www.atadore.com/images/Usi.NETMVCandAJAXControlToolkitListSearc_B2B2/image.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="194" alt="" src="http://www.atadore.com/images/Usi.NETMVCandAJAXControlToolkitListSearc_B2B2/image_thumb.png" width="244" align="left" border="0" /></a> <a href="http://www.atadore.com/images/Usi.NETMVCandAJAXControlToolkitListSearc_B2B2/image_3.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="168" alt="" src="http://www.atadore.com/images/Usi.NETMVCandAJAXControlToolkitListSearc_B2B2/image_thumb_3.png" width="244" border="0" /></a> </p>
<p>&#160;</p>
<p>Once you do this, you should see the two folders that you copied into the <em>Content</em> folder.&#160; Right click on each folder and select <em>Include In Project</em>.</p>
<p>Now your MVC project will have access to the JavaScript files it requires.</p>
<h2>Add the SELECT</h2>
<p>To make use of these JavaScript libraries, open the Home action's Index view under <em>Views-&gt;Home-&gt;Index.aspx</em>.&#160; Modify the HTML to include a simple SELECT List:</p>
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&lt;%@ Page Language=<span style="color: #006080">&quot;C#&quot;</span> ... %&gt;

&lt;asp:Content ID=<span style="color: #006080">&quot;indexContent&quot;</span> ContentPlaceHolderID=<span style="color: #006080">&quot;MainContent&quot;</span> runat=<span style="color: #006080">&quot;server&quot;</span>&gt;
    &lt;h2&gt; &lt;%= Html.Encode(ViewData[<span style="color: #006080">&quot;Message&quot;</span>]) %&gt;&lt;/h2&gt;
    &lt;p&gt;
        To learn more about ASP.NET MVC visit ...
    &lt;/p&gt;

    &lt;select id=<span style="color: #006080">&quot;Countries&quot;</span>&gt;
    &lt;option&gt;Switzerland&lt;/option&gt;
    &lt;option&gt;United Kindom&lt;/option&gt;
    &lt;option&gt;United States&lt;/option&gt;
    &lt;/select&gt;

&lt;/asp:Content&gt;</pre>
</div>
<div>&#160;</div>
<h2>Include the required Javascript files</h2>
<p>Next you'll need to have the page pull in the JavaScript files that are used by the ListSearch Extender:</p>
<div>
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">&lt;script type=<span style="color: #006080">&quot;text/javascript&quot;</span> src=<span style="color: #006080">&quot;/Content/MicrosoftAjaxLibrary/System.Web.Extensions/3.5.0.0/3.5.21022.8/MicrosoftAjax.debug.js&quot;</span>/&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&lt;script src=<span style="color: #006080">&quot;/Content/AjaxControlToolkit/3.0.20820.16598/3.0.20820.0/AjaxControlToolkit.Common.Common.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">&lt;script src=<span style="color: #006080">&quot;/Content/AjaxControlToolkit/3.0.20820.16598/3.0.20820.0/AjaxControlToolkit.ExtenderBase.BaseScripts.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&lt;script src=<span style="color: #006080">&quot;/Content/AjaxControlToolkit/3.0.20820.16598/3.0.20820.0/AjaxControlToolkit.DynamicPopulate.DynamicPopulateBehavior.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">&lt;script src=<span style="color: #006080">&quot;/Content/AjaxControlToolkit/3.0.20820.16598/3.0.20820.0/AjaxControlToolkit.Compat.Timer.Timer.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&lt;script src=<span style="color: #006080">&quot;/Content/AjaxControlToolkit/3.0.20820.16598/3.0.20820.0/AjaxControlToolkit.Animation.Animations.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">&lt;script src=<span style="color: #006080">&quot;/Content/AjaxControlToolkit/3.0.20820.16598/3.0.20820.0/AjaxControlToolkit.Animation.AnimationBehavior.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&lt;script src=<span style="color: #006080">&quot;/Content/AjaxControlToolkit/3.0.20820.16598/3.0.20820.0/AjaxControlToolkit.PopupExtender.PopupBehavior.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">&lt;script src=<span style="color: #006080">&quot;/Content/AjaxControlToolkit/3.0.20820.16598/3.0.20820.0/AjaxControlToolkit.PopupControl.PopupControlBehavior.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&lt;script src=<span style="color: #006080">&quot;/Content/AjaxControlToolkit/3.0.20820.16598/3.0.20820.0/AjaxControlToolkit.ListSearch.ListSearchBehavior.js&quot;</span> type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;</pre>
</p></div>
</div>
<div>&#160;</div>
<div>You may need to change the version numbers depending on the versions of the Microsoft AJAX library and Toolkits you downloaded.</div>
<div>&#160;</div>
<div>I found out which script files to include by creating a normal ASP.NET Project that used the ListSearch Extender, and set the ScriptManager's ScriptPath property to a new folder I created in the project called <em>/MicrosoftAjaxLibrary</em>, to which I copied the same two folders that I copied to the <em>Content</em> folder above.&#160; I accessed the page, and did a View Source to see what JavaScript was being used.</div>
<div>&#160;</div>
<h2>Initialize the Extender</h2>
<p>Having included the required JavaScript files, you can now create a new ListSearch Extender and attach it to the SELECT you created above:</p>
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&lt;script type=<span style="color: #006080">&quot;text/javascript&quot;</span>&gt;
    Sys.Application.initialize();
    Sys.Application.add_init(<span style="color: #0000ff">function</span>() {
    $create(AjaxControlToolkit.ListSearchBehavior,
            { <span style="color: #006080">&quot;id&quot;</span>: <span style="color: #006080">&quot;ListBox1_ListSearchExtender&quot;</span> },
            <span style="color: #0000ff">null</span>, <span style="color: #0000ff">null</span>, $get(<span style="color: #006080">&quot;Countries&quot;</span>));
    });
&lt;/script&gt;</pre>
</div>
<div>&#160;</div>
<h2></h2>
<h2></h2>
<h2>Access your page</h2>
<div>&#160;</div>
<div>Now when you run you'll get the ListSearch Extender behavior attached to your SELECT:</div>
<div><a href="http://www.atadore.com/images/Usi.NETMVCandAJAXControlToolkitListSearc_B2B2/image_4.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="303" alt="" src="http://www.atadore.com/images/Usi.NETMVCandAJAXControlToolkitListSearc_B2B2/image_thumb_4.png" width="476" border="0" /></a></div>
<div>&#160;</div>
<h2>Summary </h2>
<div>&#160;</div>
<div>Using the AJAX Control Toolkit is very straight-forward.&#160; The trickiest part is determining exactly what script files you need to include.</div>
<div>&#160;</div>
<div>Now you can use the whole set of behaviors that other people have created to add AJAX goodness to your ASP.NET MVC projects.</div>
]]></content:encoded>
			<wfw:commentRss>http://damianblog.com/2008/09/07/using-aspnet-mvc-and-the-ajax-control-toolkit/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Dealing with &quot;Sys.InvalidOperationException: Handler was not added through the Sys.UI.DomEvent.addHandler method.&quot;</title>
		<link>http://damianblog.com/2007/08/13/not-added-through-addhandler/</link>
		<comments>http://damianblog.com/2007/08/13/not-added-through-addhandler/#comments</comments>
		<pubDate>Mon, 13 Aug 2007 10:37:42 +0000</pubDate>
		<dc:creator>dmehers</dc:creator>
				<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http://damianblog.com/2007/08/13/not-added-through-addhandler/</guid>
		<description><![CDATA[In the ListSearch extender I recently had a bug where you got an exception when leaving a page that had a ListBox on it, where the ListBox was the target of both a CascadingDropDown extender and a ListSearch extender. The reason was pretty dumb-- I was calling $clearHandlers(listBox) in the dispose method on the ListSearch [...]]]></description>
			<content:encoded><![CDATA[<p>In the <a href="http://asp.net/ajax/control-toolkit/live/ListSearch/ListSearch.aspx" target="_blank">ListSearch</a> extender I recently had a bug where you got an exception when leaving a page that had a ListBox on it, where the ListBox was the target of both a CascadingDropDown extender and a ListSearch extender.</p>
<p>The reason was pretty dumb-- I was calling <em><a href="http://asp.net/ajax/documentation/live/clientreference/Global/ClearHandlersShortcutMethod.aspx" target="_blank">$clearHandlers</a>(listBox)</em> in the <em>dispose</em> method on the ListSearch Extender, and this was removing the handlers that the CascadingDropDown had set up.&nbsp; So when the CascadingDropDown's <em>dispose</em> method tried to clean up its event subscriptions, the ASP.NET AJAX runtime complained that it was not subscribed.</p>
<p>The solution was&nbsp;replace calls to&nbsp;<em><a href="http://asp.net/ajax/documentation/live/clientreference/Global/AddHandlersShortcutMethod.aspx" target="_blank">$addHandlers</a></em> and <em><a href="http://asp.net/ajax/documentation/live/clientreference/Global/ClearHandlersShortcutMethod.aspx" target="_blank">$clearHandlers</a></em> with individual calls to <em><a href="http://asp.net/AJAX/Documentation/Live/ClientReference/Global/AddHandlerShortcutMethod.aspx" target="_blank">$addHandler</a></em> and&nbsp;<em><a href="http://asp.net/AJAX/Documentation/Live/ClientReference/Global/RemoveHandlerShortcutMethod.aspx" target="_blank">$removeHandler</a> </em>for each individual event in the ListSearch's <em>initialize</em> and <em>dispose</em> methods.</p>
<p>Unfortunately after implementing this solution I still got the same error ... after a lot of head-scratching, it turned out to be a simple typo.&nbsp; I was calling <em>$addHandler</em> with 'keydown' as the event name, and calling <em>$removeHandler</em> with 'key<u>D</u>own' as the event name.</p>
<p>A couple of things for you to check if you get the same error.</p>
]]></content:encoded>
			<wfw:commentRss>http://damianblog.com/2007/08/13/not-added-through-addhandler/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Dynamically creating ASP.NET AJAX controls</title>
		<link>http://damianblog.com/2007/06/26/dynamically-create-ajax-controls/</link>
		<comments>http://damianblog.com/2007/06/26/dynamically-create-ajax-controls/#comments</comments>
		<pubDate>Tue, 26 Jun 2007 04:51:02 +0000</pubDate>
		<dc:creator>dmehers</dc:creator>
				<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http://damianblog.com/2007/06/26/dynamically-create-ajax-controls/</guid>
		<description><![CDATA[In my previous post I showed how you can cache large HTML elements, such as SELECTs in the web browser's document cache.&#160; What if you want to dynamically create and attach ASP.NET AJAX Control Extenders to the dynamically created SELECT? I've already shown how you can call extenders from JavaScript, but if you want to [...]]]></description>
			<content:encoded><![CDATA[<p>In my <a href="/2007/06/24/browser-cache/">previous post</a> I showed how you can cache large HTML elements, such as SELECTs in the web browser's document cache.&nbsp; What if you want to dynamically create and attach ASP.NET AJAX Control Extenders to the dynamically created SELECT?</p>
<p>I've <a href="/2007/02/28/calling-extenders-from-js/">already shown</a> how you can call extenders from JavaScript, but if you want to create and delete them from scratch, you can&nbsp;use&nbsp;functions such as&nbsp;these:</p>
<pre><span style="color:rgb(0,0,255);">function</span> AddListSearchTo(list) {
    list.listSearch = $create(AjaxControlToolkit.ListSearchBehavior,
                              { <span style="color:rgb(163,21,21);">'promptCssClass'</span> : <span style="color:rgb(163,21,21);">'listSearchPrompt'</span> },
                              {}, {}, list);
}

<span style="color:rgb(0,0,255);">function</span> RemoveListSearchFrom(list) {
    <span style="color:rgb(0,0,255);">if</span>(list.listSearch ) {
        list.listSearch .dispose();
        list.listSearch = <span style="color:rgb(0,0,255);">null</span>;
    }
}
</pre>
<p>I use an expando on the target SELECT to point to the ListSearch Extender that I've dynamically created, which means that I can easily get hold of it if I want to remove it.&nbsp; </p>
<p>As you can see you can easily pass initial properties too.&nbsp; The $create function is a shortcut to <a href="http://ajax.asp.net/docs/ClientReference/Sys/ComponentClass/ComponentCreateMethod.aspx">Sys.Component.create</a></p>
<p>I use these functions when dynamically fetching HTML SELECTs from the server, in response to user input -- I've rolled my own CascadingDropDown. When I get the new SELECT back from the server the first thing I do is remove the existing extender from the existing SELECT, then I replace the old SELECT with the new one that I've just received, and then I dynamically instantiate a new ListSearch extender:</p>
<pre><span style="color:rgb(0,0,255);">function</span> OnGetListSucceded(list) {
    <span style="color:rgb(0,0,255);">var</span> theListDiv = $get(<span style="color:rgb(163,21,21);">'TheListDiv'</span>); // Contains TheList
    <span style="color:rgb(0,0,255);">var</span> theList = $get(<span style="color:rgb(163,21,21);">'TheList'</span>);       // An HTML SELECT
    RemoveListSearchFrom(theList);

    theListDiv.innerHTML = list;
    theList = $get(<span style="color:rgb(163,21,21);">'TheList'</span>);
    AddListSearchTo(theList);
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://damianblog.com/2007/06/26/dynamically-create-ajax-controls/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Caching large HTML elements in the Browser&#8217;s document cache</title>
		<link>http://damianblog.com/2007/06/24/browser-cache/</link>
		<comments>http://damianblog.com/2007/06/24/browser-cache/#comments</comments>
		<pubDate>Sun, 24 Jun 2007 06:17:27 +0000</pubDate>
		<dc:creator>dmehers</dc:creator>
				<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http://damianblog.com/2007/06/24/browser-cache/</guid>
		<description><![CDATA[Sometimes we have to do things that we know are wrong. For example, in my current project we have to present a list of customers so that the user can select one or more of them.&#160; I work for a large company that has been around for many many years, and the list of customers [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes we have to do things that we know are wrong.</p>
<p>For example, in my current project we have to present a list of customers so that the user can select one or more of them.&nbsp; I work for a large company that has been around for many many years, and the list of customers can exceed 15,000 for some countries.</p>
<p>But I can't decide which ones should be shown, and which ones should not be shown.&nbsp; Instead I need to show the complete list to the user.&nbsp;&nbsp; What is painful is that it can take a bit of time for this list to be sent down to the browser.&nbsp; It would be much better would be if the customer list could be cached on the <strong>browser's document cache</strong>.&nbsp; This is what this blog post is about.</p>
<p>Note that in order for this to work, the list is presented as a simple HTML SELECT, and the selected items need to be processed correspondingly on the server using the Request.Form[SelectName] property.</p>
<p>In the ASPX page, I define my customer list like this:&nbsp;</p>
<pre><span style="color:rgb(0,0,255);">&lt;</span><span style="color:rgb(163,21,21);">div</span> <span style="color:rgb(255,0,0);">id</span><span style="color:rgb(0,0,255);">="ListDiv"&gt;
</span>    <span style="color:rgb(0,0,255);">&lt;</span><span style="color:rgb(163,21,21);">select</span> <span style="color:rgb(255,0,0);">id</span><span style="color:rgb(0,0,255);">="List"</span> <span style="color:rgb(255,0,0);">multiple</span><span style="color:rgb(0,0,255);">="multiple"</span> <span style="color:rgb(255,0,0);">size</span><span style="color:rgb(0,0,255);">="15"</span> <span style="color:rgb(255,0,0);">disabled</span><span style="color:rgb(0,0,255);">="disabled"&gt;
</span>        <span style="color:rgb(0,0,255);">&lt;</span><span style="color:rgb(163,21,21);">option</span><span style="color:rgb(0,0,255);">&gt;</span>Loading List ...<span style="color:rgb(0,0,255);">&lt;/</span><span style="color:rgb(163,21,21);">option</span><span style="color:rgb(0,0,255);">&gt;
</span>        <span style="color:rgb(0,0,255);">&lt;</span><span style="color:rgb(163,21,21);">option</span><span style="color:rgb(0,0,255);">&gt;</span>This may take a moment the first time...<span style="color:rgb(0,0,255);">&lt;/</span><span style="color:rgb(163,21,21);">option</span><span style="color:rgb(0,0,255);">&gt;
</span>    <span style="color:rgb(0,0,255);">&lt;/</span><span style="color:rgb(163,21,21);">select</span><span style="color:rgb(0,0,255);">&gt;
&lt;/</span><span style="color:rgb(163,21,21);">div</span><span style="color:rgb(0,0,255);">&gt;
</span></pre>
<p><a href="http://11011.net/software/vspaste"><a href="http://11011.net/software/vspaste"></a></p>
<p>Note that the SELECT is surrounded by a DIV, so that I can replace the DIV contents with a new list.</p>
<p>Then I have some JavaScript that fires when the page loads, and asynchronously fetches the list:</p>
<pre><span style="color:rgb(0,0,255);">&lt;</span><span style="color:rgb(163,21,21);">script</span> <span style="color:rgb(255,0,0);">language</span><span style="color:rgb(0,0,255);">="javascript"</span> <span style="color:rgb(255,0,0);">type</span><span style="color:rgb(0,0,255);">="text/javascript"&gt;
</span><span style="color:rgb(0,128,0);">// This is called by the ASP.NET AJAX Framework automatically
</span><span style="color:rgb(0,0,255);">function</span> pageLoad() {
    <span style="color:rgb(0,0,255);">var</span> wRequest =  <span style="color:rgb(0,0,255);">new</span> Sys.Net.WebRequest();
    wRequest.set_url(<span style="color:rgb(163,21,21);">'ListHandler.ashx?Version=&lt;%=ListVersion.Value%&gt;)'</span>);
    wRequest.set_httpVerb(<span style="color:rgb(163,21,21);">"GET"</span>); <span style="color:rgb(0,128,0);">// GETs can be cached, POSTs can not
</span>    wRequest.add_completed(OnFetchListCompleted);
    wRequest.invoke();
}
</pre>
<p>The <em>pageLoad</em> function gets invoked automatically.&nbsp; It simply fires off an HTTP GET request to a handler, passing as a parameter the value of the <em>ListVersion</em> hidden field.&nbsp; By changing the value of this field, the server-side code can control when the browser-cached contents are expired, and a new version is fetched (since changing the URL will mean there is no browser-cached version).</p>
<p>When the response comes back, it replaces the contents of the DIV with the value that is returned from the handler:</p>
<pre><span style="color:rgb(0,0,255);">function</span> OnFetchListCompleted(executor, eventArgs)
{
    <span style="color:rgb(0,0,255);">var</span> listDiv = $get(<span style="color:rgb(163,21,21);">'ListDiv'</span>);

    <span style="color:rgb(0,0,255);">if</span>(executor.get_responseAvailable())
    {
        <span style="color:rgb(0,0,255);">var</span> list = executor.get_responseData();
        <span style="color:rgb(0,0,255);">if</span>(list &amp;&amp; list.startsWith(<span style="color:rgb(163,21,21);">'&lt;select'</span>)) {
            listDiv.innerHTML = list;
        }
    }
}
<span style="color:rgb(0,0,255);">&lt;/</span><span style="color:rgb(163,21,21);">script</span><span style="color:rgb(0,0,255);">&gt;
</span></pre>
<p>The handler simply generates the appropriate content:</p>
<pre><span style="background:rgb(255,238,98);">&lt;%<span style="color:rgb(0,0,255);"></span>@</span> <span style="color:rgb(163,21,21);">WebHandler</span> <span style="color:rgb(255,0,0);">Language</span><span style="color:rgb(0,0,255);">="C#"</span> <span style="color:rgb(255,0,0);">Class</span><span style="color:rgb(0,0,255);">="ListHandler"</span> <span style="background:rgb(255,238,98);">%&gt;

<span style="color:rgb(0,0,255);"></span></span><span style="color:rgb(0,0,255);">using</span> System;
<span style="color:rgb(0,0,255);">using</span> System.Web;
<span style="color:rgb(0,0,255);">using</span> System.Web.UI;
<span style="color:rgb(0,0,255);">using</span> System.Web.UI.WebControls;
<span style="color:rgb(0,0,255);">using</span> System.Collections.Generic;

<span style="color:rgb(0,0,255);">public</span> <span style="color:rgb(0,0,255);">class</span> <span style="color:rgb(43,145,175);">ListHandler</span> : <span style="color:rgb(43,145,175);">IHttpHandler</span> {

    <span style="color:rgb(0,0,255);">public</span> <span style="color:rgb(0,0,255);">void</span> ProcessRequest (<span style="color:rgb(43,145,175);">HttpContext</span> context) {
        context.Response.Clear();
        context.Response.ContentType = <span style="color:rgb(163,21,21);">"text/html"</span>;
<strong>        context.Response.Cache.SetCacheability(<span style="color:rgb(43,145,175);">HttpCacheability</span>.Public);
        context.Response.Cache.SetExpires(<span style="color:rgb(43,145,175);">DateTime</span>.Now.AddMonths(1));
        context.Response.Cache.SetSlidingExpiration(<span style="color:rgb(0,0,255);">true</span>);
</strong>
        <span style="color:rgb(43,145,175);">HtmlTextWriter</span> htmlTextWriter = <span style="color:rgb(0,0,255);">new</span> <span style="color:rgb(43,145,175);">HtmlTextWriter</span>(
            context.Response.Output);
        <span style="color:rgb(43,145,175);">ListBox</span> listBox = GetListBox();
        listBox.RenderControl(htmlTextWriter);
        htmlTextWriter.Flush();

        context.Response.End();
    }

    <span style="color:rgb(0,0,255);">private</span> <span style="color:rgb(0,0,255);">static</span> <span style="color:rgb(43,145,175);">ListBox</span> GetListBox()
    {
        <span style="color:rgb(43,145,175);">ListBox</span> listBox = <span style="color:rgb(0,0,255);">new</span> <span style="color:rgb(43,145,175);">ListBox</span>();</pre>
<pre> ...
        <span style="color:rgb(0,0,255);">return</span> listBox;
    }</pre>
<pre>... </pre>
<p><a href="http://11011.net/software/vspaste"></a>Note the bolded directives to enforce the browser-side caching of the response.</p>
<p>I have a complete example <a href="http://www.atadore.com/demos/ClientCached.zip">here</a>.</p>
<p>You might be wondering why I've used the Sys.Net.WebRequest mechanism with the HttpHandler.&nbsp; Why not simply use a Web Service?&nbsp;That would indeed be simpler, however there is no easy way to set the appropriate cache expiration headers, although it <em>is</em> possible if you are willing to use reflection -- the PageFlakes guys use it to <a href="http://msmvps.com/blogs/omar/archive/2006/09/23/Atlas-7_3A00_-Caching-web-service-response-on-browser-and-save-bandwidth-significantly.aspx">speed up their pages</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://damianblog.com/2007/06/24/browser-cache/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Speeding Up ListSearch Extender initialization with massive lists</title>
		<link>http://damianblog.com/2007/06/19/speeding-up-listsearchextender/</link>
		<comments>http://damianblog.com/2007/06/19/speeding-up-listsearchextender/#comments</comments>
		<pubDate>Tue, 19 Jun 2007 08:52:18 +0000</pubDate>
		<dc:creator>dmehers</dc:creator>
				<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http://damianblog.com/2007/06/19/speeding-up-listsearchextender/</guid>
		<description><![CDATA[When a ListBox that has an associated ListSearch Extender is first used, the ListSearch Extender does some one-time initialization. It delays this work&#160;this for very good reasons, as&#160;Ted Glaza explains here. The extender needs to decide whether it can use the very fast binary search when the user types, or whether it must use the [...]]]></description>
			<content:encoded><![CDATA[<p>When a ListBox that has an associated ListSearch Extender is first used, the ListSearch Extender does some one-time initialization.
<p>It delays this work&nbsp;this for very good reasons, as&nbsp;Ted Glaza explains <a href="http://forums.asp.net/p/1120076/1746235.aspx#1746235">here</a>.
<p>The extender needs to decide whether it can use the very fast binary search when the user types, or whether it must use the slower linear search.&nbsp; It does this by determining if the list is sorted, which can take a long time if there are thousands and thousands of entries in the ListBox.
<p>The best thing would be to somehow give the ListSearch Extender a hint as to whether the ListBox is already sorted or not.
<p>You can do this by making a couple of changes to the ListSearch extender.&nbsp; If you'd like to see this behaviour become a standard part of the ListSearch Extender, please <a href="http://www.codeplex.com/AtlasControlToolkit/WorkItem/AdvancedList.aspx">vote</a> for it and I'll add it if there is sufficient interest.
<p>Modifying the ListSearch Extender is extremely simple.&nbsp; First download the AJAX Control Toolkit, and then open the AjaxControlToolkit.sln
<p>Open the behaviour JavaScript file "ListSearchBehavior.js".&nbsp; At the top of the file you'll see some properties.
<p>Add a couple of new property:<br />&nbsp;&nbsp;&nbsp; // Properties<br />&nbsp;&nbsp;&nbsp; this._isSortedHintSet = false;<br />&nbsp;&nbsp;&nbsp; this._isSortedHint = false;<br />...
<p>These indicate whether the user has told the extender if the list is sorted or not, and if so, whether it is sorted.
<p>Next find the "_isSorted" function, and at the start of it (after the documentation comment), add this code:
<p>if(this._isSortedHintSet) {<br />&nbsp;&nbsp;&nbsp; return this._isSortedHint;<br />}<br />...
<p>Finally you need to expose this property so that it can be set from outside the class, although you could actually set the&nbsp; _isSortedHintSet and _isSortedHint from JavaScript, this is considered very bad form since the underscore prefix indicates they are private.
<p>Define a getter and setter accessor at the end of the bevahior, where you'll find the other accessors:<br />&nbsp;&nbsp;&nbsp; get_isSortedHint : function() {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;value type="AjaxControlToolkit.ListSearchPromptPosition"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// Where the prompt should be positioned relative to the target control.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// Can be Top (default) or Bottom<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;/value&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return this._isSortedHint;<br />&nbsp;&nbsp;&nbsp; },
<p>&nbsp;&nbsp;&nbsp; set_isSortedHint : function(value) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!this._isSortedHintSet || this._isSortedHint != value) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this._isSortedHintSet = true;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this._isSortedHint = value;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.raisePropertyChanged('isSortedHint');<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }
<p>If you add these two functions after the existing last function (which is "set_raiseImmediateOnChange" in the current build), then you must be sure to add a comma after the closing brace of this last function:<br />...<br />&nbsp;&nbsp;&nbsp; },
<p>&nbsp;&nbsp;&nbsp; get_isSortedHint : function() {<br />....
<p>Build the solution, and make sure projects that use the AJAX Control Toolkit now reference the AjaxControlToolkit.dll in AjaxControlToolkit\AjaxControlToolkit\bin\Debug
<p>Now you can set this property in JavaScript when your page first loads, so that the extender does not have to work out whether the list is sorted:
<pre>    &lt;form id=<span class="str">"form1"</span> runat=<span class="str">"server"</span>&gt;
        &lt;asp:ScriptManager ID=<span class="str">"SM1"</span> runat=<span class="str">"server"</span> /&gt;

        &lt;asp:ListBox ID=<span class="str">"LB1"</span> runat=<span class="str">"server"</span>&gt;
            &lt;asp:ListItem&gt;Hello&lt;/asp:ListItem&gt;
        &lt;/asp:ListBox&gt;
        &lt;cc1:ListSearchExtender ID=<span class="str">"LSE1"</span> runat=<span class="str">"server"</span>
            TargetControlID=<span class="str">"LB1"</span>&gt;&lt;/cc1:ListSearchExtender&gt;

        &lt;script language=<span class="str">"javascript"</span> type=<span class="str">"text/javascript"</span>&gt;
            <span class="kwrd">function</span> <strong>pageLoad</strong>(sender, args) {
                <span class="kwrd">var</span> extender = $find(<span class="str">'LSE1'</span>);
                <span class="kwrd">if</span>(extender) {
                    extender.set_isSortedHint(<span class="kwrd">true</span>);
                }
            }
        &lt;/script&gt;
    &lt;/form&gt;
</pre>
<p>This is the complete code (no changes to the code-behind file).</p>
<p>The pageLoad function is called automatically by the ASP.NET AJAX Framework (see <a title="http://ajax.asp.net/docs/overview/AJAXClientEvents.aspx" href="http://ajax.asp.net/docs/overview/AJAXClientEvents.aspx">http://ajax.asp.net/docs/overview/AJAXClientEvents.aspx</a>) when all controls within the page have been loaded.</p>
<p>The function first finds the ListSearch Extender, and then gives it a hint that the list that it is targeting is actually sorted. </p>
<p>If you wanted to be able to set the property from the server side, instead of from JavaScript, you can edit the ListSearchExtender.cs file, and add the appropriate declaration of the property: </p>
<pre>        [ExtenderControlProperty]
        [ClientPropertyName(<span class="str">"isSortedHint"</span>)]
        [DefaultValue(<span class="str">""</span>)]
        <span class="kwrd">public</span> <span class="kwrd">string</span> IsSortedHint
        {
            get { <span class="kwrd">return</span> GetPropertyValue(<span class="str">"isSortedHint"</span>, <span class="str">""</span>); }
            set { SetPropertyValue(<span class="str">"isSortedHint"</span>, <span class="kwrd">value</span>); }
        }
</pre>
<pre> </pre>
]]></content:encoded>
			<wfw:commentRss>http://damianblog.com/2007/06/19/speeding-up-listsearchextender/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Hiding the ListSearch Extender Prompt Message</title>
		<link>http://damianblog.com/2007/06/19/hide-lse-prompt/</link>
		<comments>http://damianblog.com/2007/06/19/hide-lse-prompt/#comments</comments>
		<pubDate>Tue, 19 Jun 2007 06:13:18 +0000</pubDate>
		<dc:creator>dmehers</dc:creator>
				<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http://damianblog.com/2007/06/19/hide-lse-prompt/</guid>
		<description><![CDATA[You can hide the ListSearch Extender's prompt message, so that it does not show, by setting the style to "display:none", like this. Define a CSS class in a StyleSheet"StyleSheet.css":.DontShowListSearchPrompt {&#160;&#160;&#160; display:none;} Then in your ASPX use the Style for the ListSearch Prompt: &#60;head runat="server"&#62;&#160;&#160;&#160; &#60;title&#62;Don't show ListSearch Extender Prompt&#60;/title&#62;&#160;&#160;&#160; &#60;link href="StyleSheet.css" rel="stylesheet" type="text/css" /&#62;&#60;/head&#62;&#60;body&#62;&#160;&#160;&#160; &#60;form [...]]]></description>
			<content:encoded><![CDATA[</p>
<p>You can hide the ListSearch Extender's prompt message, so that it does not show, by setting the style to "display:none", like this.
<p>Define a CSS class in a StyleSheet"StyleSheet.css":<br />.<strong>DontShowListSearchPrompt</strong> <br />{<br />&nbsp;&nbsp;&nbsp; display:none;<br />}
<p>Then in your ASPX use the Style for the ListSearch Prompt:
<p>&lt;head runat="server"&gt;<br />&nbsp;&nbsp;&nbsp; &lt;title&gt;Don't show ListSearch Extender Prompt&lt;/title&gt;<br />&nbsp;&nbsp;&nbsp; &lt;link href="StyleSheet.css" rel="stylesheet" type="text/css" /&gt;<br />&lt;/head&gt;<br />&lt;body&gt;<br />&nbsp;&nbsp;&nbsp; &lt;form id="form1" runat="server"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:ScriptManager ID="SM1" runat="server" /&gt;
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:ListBox ID="LB1" runat="server"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:ListItem&gt;Hello&lt;/asp:ListItem&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/asp:ListBox&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;cc1:ListSearchExtender ID="LSE1" runat="server"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PromptCssClass="<strong>DontShowListSearchPrompt</strong>"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TargetControlID="LB1"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/cc1:ListSearchExtender&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/form&gt;<br />&lt;/body&gt;<br />&lt;/html&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://damianblog.com/2007/06/19/hide-lse-prompt/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Automatically attaching Extenders to Controls using Control Adapters &#8211; demo posted</title>
		<link>http://damianblog.com/2007/02/28/adapters-extenders-demo/</link>
		<comments>http://damianblog.com/2007/02/28/adapters-extenders-demo/#comments</comments>
		<pubDate>Wed, 28 Feb 2007 07:26:21 +0000</pubDate>
		<dc:creator>dmehers</dc:creator>
				<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http://damianblog.wordpress.com/2007/02/28/automatically-attaching-extenders-to-controls-using-control-adapters-demo-posted/</guid>
		<description><![CDATA[I get a lot of hits on this article I posted last year, showing how you can use ASP.NET Control Adapters to automatically attach Control Extenders to a specific kind of ASP.NET control throughout an existing web site, without modifying any of the existing pages. It uses a Control Adapter to create and attach extenders to [...]]]></description>
			<content:encoded><![CDATA[<p>I get a lot of hits on <a href="http://damianblog.com/2006/11/16/adapters-and-extenders/">this article </a>I posted last year, showing how you can use ASP.NET Control Adapters to automatically attach Control Extenders to a specific kind of ASP.NET control throughout an existing web site, without modifying any of the existing pages.</p>
<p>It uses a Control Adapter to create and attach extenders to the target controls, and also an HttpModule to ensure that all pages have a ScriptManager or ScriptManagerProxy.</p>
<p>Anyway, I finally got around to uploading a <a href="http://www.atadore.com/Demos/AdaptersAndExtenders.zip">demo project</a> showing this.  It is slightly different to the article, since it shows how to attach a DropShadow extender to all UpdatePanels on your site.  Not something you will necessarily want to do, but you get the point.</p>
<p>The demo project is <a href="http://www.atadore.com/Demos/AdaptersAndExtenders.zip">here</a>.  It consists of a class project containing the Control Adapter and Http Module, and then a sample web site with a <em>.browsers</em> file to cause the adapter to be used, and a modified <em>web.config</em> to let the Http Module do its stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://damianblog.com/2007/02/28/adapters-extenders-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calling AJAX Control Extenders from JavaScript code</title>
		<link>http://damianblog.com/2007/02/28/calling-extenders-from-js/</link>
		<comments>http://damianblog.com/2007/02/28/calling-extenders-from-js/#comments</comments>
		<pubDate>Wed, 28 Feb 2007 06:06:30 +0000</pubDate>
		<dc:creator>dmehers</dc:creator>
				<category><![CDATA[AJAX]]></category>

		<guid isPermaLink="false">http://damianblog.wordpress.com/2007/02/28/calling-extenders-from-js/</guid>
		<description><![CDATA[I am a big fan of declarative programming.  It reduces the risk of errors, saves on mundane coding and lets me say what I want to do and someone else can figure out the how (although I like to understand the how too . That said, when you find yourself doing strange and unnatural things simply [...]]]></description>
			<content:encoded><![CDATA[<p>I am a big fan of declarative programming.  It reduces the risk of errors, saves on mundane coding and lets me say <em>what</em> I want to do and someone else can figure out the <em>how</em> (although I like to understand the <em>how</em> too <img src='http://damianblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<p>That said, when you find yourself doing strange and unnatural things simply to be able to use declarative programming then you know you've gone too far.</p>
<p>I found myself in this kind of situation recently.  I have a very large GridView and for one of the columns I wanted to display a <a href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx">ModalPopup </a>whenever the user clicked on the corresponding item in each row, where they could select information related to that item.</p>
<p>What I could have done is to hook up an instance of the ModalPopup in the template, so that for each row a new ModalPopup would be created.</p>
<p>Instead what I did was to define a single ModalPopup outside of the GridView, targeted at a dummy hidden LinkButton (with no label):</p>
<p><font size="2"><font size="2" color="#0000ff">&lt;</font><font size="2" color="#800000">asp</font><font size="2" color="#0000ff">:</font><font size="2" color="#800000">LinkButton</font><font size="2"> </font><font size="2" color="#ff0000">ID</font><font size="2" color="#0000ff">="DummyHiddenLinkButton"</font><font size="2"> </font><font size="2" color="#ff0000">runat</font><font size="2" color="#0000ff">="server"&gt;&lt;/</font><font size="2" color="#800000">asp</font><font size="2" color="#0000ff">:</font><font size="2" color="#800000">LinkButton</font><font size="2" color="#0000ff">&gt;</font></font></p>
<p><font size="2"><font size="2"><font size="2" color="#0000ff">&lt;</font><font size="2" color="#800000">cc1</font><font size="2" color="#0000ff">:</font><font size="2" color="#800000">ModalPopupExtender</font><font size="2"> </font><font size="2" color="#ff0000">ID</font><font size="2" color="#0000ff">="<strong>SelectYxzModalPopupExtender</strong>"<br />
                                                          </font><font size="2" color="#ff0000">runat</font><font size="2" color="#0000ff">="server"</font><font size="2"> <br />
                                                          </font><font size="2" color="#ff0000">TargetControlID</font><font size="2" color="#0000ff">="DummyHiddenLinkButton"<br />
                                                          </font><font size="2" color="#ff0000">PopupControlID</font><font size="2" color="#0000ff">="SelectYxzPanel"</font><font color="#ff0000"><font size="2"> <br />
                                                          </font></font></font></font><font size="2"><font size="2"><font color="#ff0000"><font size="2">OkControlID</font></font><font size="2" color="#0000ff">="SelectYxzOKButton"</font><font size="2"> </font><font size="2" color="#0000ff">&gt;</font></font></font><font size="2"><br />
</font><font size="2" color="#0000ff">&lt;/</font><font size="2" color="#800000">cc1</font><font size="2" color="#0000ff">:</font><font size="2" color="#800000">ModalPopupExtender</font><font size="2" color="#0000ff">&gt;</font></p>
<p>Then in the template I hooked up the onclick method of the item to invoke a JavaScript function  passing as a parameter key information related to the item.</p>
<p>Inside my JavaScript function I first initialize the Panel with information related to the item (in my case by invoking a page method), and then I programatically cause the ModalPopup to show:<br />
<code><br />
<font color="#0000ff">function</font> OnItemLinkClicked(someId) {<br />
    PageMethods.SomePageMethod(someId,<br />
                               OnSomePageMethodSucceded,<br />
                               OnSomePageMethodFailed);<br />
}</code></p>
<p><code></code><code><font color="#0000ff">function</font> OnSomePageMethodSucceded(result) {<br />
    <strong><font color="#0000ff">var</font> extender = $find('SelectYxzModalPopupExtender');</strong><br />
    <font color="#0000ff">var</font> someList = $get('SomeListInTheModalPanel');<br />
    if(!extender || !someList) { ...<br />
    }<br />
    someList.options.length = 0;<br />
    for(<font color="#0000ff">var</font> i = 0; i &lt; result.length; i++) {<br />
        <font color="#0000ff">var</font> option = document.createElement('OPTION');<br />
        option.text = result[i].Text;<br />
        option.value = result[i].Value;<br />
        someList.options.add(option);<br />
    }<br />
    <strong>extender.show();</strong><br />
}<br />
</code></p>
<p>I've shown my call to a backend page method for completeness. I'm invoking a page method to get an array of structs related to the item that the user clicked, and then using the resulting array to populate a SELECT that I display within the modal popup.</p>
<p>But the interesting stuff is in bold. Here I am programatically finding my ModalPopup extender (using the <a href="http://ajax.asp.net/docs/ClientReference/Sys/ApplicationClass/SysApplicationFindShortcutMethod.aspx"><em>$find</em> </a>shortcut to the <em><a href="http://ajax.asp.net/docs/ClientReference/Sys/ApplicationClass/SysApplicationFindComponentMethod.aspx">Sys.Application.findComponent</a></em> method), and then invoking its show method to cause it to display. The hidden LinkButton that is its "official" target never actually gets used.</p>
<p>I discovered what methods were available on the ModalPopup extender by looking at its <a href="http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=AtlasControlToolkit">source</a>, which is available for all the control extenders when you download the AJAX Control Toolkit. Methods that are prefixed with an underscore are internal methods and I'd never call those, but I'm pretty comfortable calling the other methods, such as the handy <em>show</em> method above.</p>
]]></content:encoded>
			<wfw:commentRss>http://damianblog.com/2007/02/28/calling-extenders-from-js/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Screencast: Introduction to AJAX, ASP.NET AJAX and the AJAX Control Toolkit</title>
		<link>http://damianblog.com/2007/02/25/ajax-screencast/</link>
		<comments>http://damianblog.com/2007/02/25/ajax-screencast/#comments</comments>
		<pubDate>Sun, 25 Feb 2007 07:26:38 +0000</pubDate>
		<dc:creator>dmehers</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Screencast]]></category>

		<guid isPermaLink="false">http://damianblog.wordpress.com/2007/02/25/ajax-screencast/</guid>
		<description><![CDATA[Last Tuesday I gave a presentation in Geneva on ASP.NET AJAX and the AJAX Control toolkit, and this morning I created a one hour screencast of the presentation available here (25MB) zipped, or here (33MB) as a WMV. I tried to make it useful for someone that has at least dabbled in ASP or ASP.NET, and wants a [...]]]></description>
			<content:encoded><![CDATA[<p>Last Tuesday I gave a <a href="http://www.dotmugs.ch/events/event.aspx?eid=53">presentation in Geneva </a>on ASP.NET AJAX and the AJAX Control toolkit, and this morning I created a one hour screencast of the presentation available <a href="http://www.atadore.com/videos/damianblog.com_ajax20070225.zip">here </a>(25MB) zipped, or <a href="http://www.atadore.com/videos/damianblog.com_ajax20070225.wmv">here </a>(33MB) as a WMV.</p>
<p>I tried to make it useful for someone that has at least dabbled in ASP or ASP.NET, and wants a quick bootstrap into Microsoft's AJAX offerings.</p>
<p> It includes introductions to:</p>
<ul>
<li>AJAX</li>
<li>ASP.NET AJAX including coding demos of the UpdatePanel (including a look behind the scenes), Web Services, and the JavaScript extensions</li>
<li>The AJAX Control Toolkit including coding demos of using a couple of the control extenders</li>
<li>Creating AJAX Control Extenders including a coding demo of creating your own extenders</li>
</ul>
<p>It is encoded at quite a high level of compression so the sound is a little distorted but perfectly understandable.</p>
<p><strong>Note:</strong>I recorded this around 6am this morning, and around 55 minutes into it my three year old and five year old sons decided to make their own (very sweet) contributions to the screencast -- please forgive my momentary distraction, and when you hear me tell my three year old that he can take the money he found: he is  talking about two small coins I gave him yesterday.  This is not an attempt at bribary (honest!).</p>
<p><em>Many thanks to <a href="http://www.dotmugs.ch/member/profile.aspx?who=2">Atif Aziz </a>and <a href="http://www.dotmugs.ch/member/profile.aspx?who=5">Dominique Kuster </a>for organizing last week's presentation, and <a href="http://www.digicomp.ch/geneve">Dicomp Acadamy Suisse Romande</a> for hosting it.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://damianblog.com/2007/02/25/ajax-screencast/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
<enclosure url="http://www.atadore.com/videos/damianblog.com_ajax20070225.wmv" length="33993023" type="video/x-ms-wmv" />
		</item>
	</channel>
</rss>

