<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>ASP.NET 4.0</title>
        <link>http://www.mostlylucid.net/category/33.aspx</link>
        <description>ASP.NET 4.0</description>
        <language>en-US</language>
        <copyright>Scott Galloway</copyright>
        <generator>Subtext Version 2.1.0.5</generator>
        <item>
            <title>ASP.NET 4 Beta 1: WebForms Routing extension methods</title>
            <link>http://mostlylucid.net/archive/2009/05/19/1322.aspx</link>
            <description>&lt;p&gt;When we were adding WebForm routing to ASP.NET 4 Beta 1, we didn’t have a chance to add in a couple of methods which make working with Routes and Web Forms a lot easier!&lt;/p&gt;  &lt;p&gt;Note: the code below is ‘similar’ to that which we’re adding ASP.NET 4 Beta 2, *that* code will be of much higher quality however, this is a sample only!&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web.Routing;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; RouteExtensions&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; GetUrlForRoute(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; System.Web.UI.Page page, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; routeName, RouteValueDictionary parameters)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;             VirtualPathData vpd= RouteTable.Routes.GetVirtualPath(&lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, routeName, parameters);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; vpd.VirtualPath;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; GetUrlForRoute(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; System.Web.UI.Page page, RouteValueDictionary parameters)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;             VirtualPathData vpd = RouteTable.Routes.GetVirtualPath(&lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, parameters);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; vpd.VirtualPath;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; IgnoreRoute(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; RouteCollection routes, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; url)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;             routes.IgnoreRoute(url, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; IgnoreRoute(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; RouteCollection routes, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; url, &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; constraints)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum26"&gt;  26:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum27"&gt;  27:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (routes == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum28"&gt;  28:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum29"&gt;  29:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ArgumentNullException(&lt;span style="color: #006080"&gt;"routes"&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum30"&gt;  30:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum31"&gt;  31:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (url == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum32"&gt;  32:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum33"&gt;  33:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ArgumentNullException(&lt;span style="color: #006080"&gt;"url"&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum34"&gt;  34:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum35"&gt;  35:&lt;/span&gt;             IgnoreRouteInternal internal3 = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; IgnoreRouteInternal(url);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum36"&gt;  36:&lt;/span&gt;             internal3.Constraints = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RouteValueDictionary(constraints);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum37"&gt;  37:&lt;/span&gt;             IgnoreRouteInternal item = internal3;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum38"&gt;  38:&lt;/span&gt;             routes.Add(item);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum39"&gt;  39:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum40"&gt;  40:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum41"&gt;  41:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; Route MapRoute(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; RouteCollection routes, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; name, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; url, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; physicalFile)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum42"&gt;  42:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum43"&gt;  43:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; routes.MapRoute(name, url, physicalFile, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum44"&gt;  44:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum45"&gt;  45:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum46"&gt;  46:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; Route MapRoute(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; RouteCollection routes, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; name, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; url, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; physicalFile, &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; defaults)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum47"&gt;  47:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum48"&gt;  48:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; routes.MapRoute(name, url, physicalFile, defaults, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum49"&gt;  49:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum50"&gt;  50:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum51"&gt;  51:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; Route MapRoute(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; RouteCollection routes, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; name, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; url, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; physicalFile, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] namespaces)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum52"&gt;  52:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum53"&gt;  53:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; routes.MapRoute(name, url, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, namespaces);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum54"&gt;  54:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum55"&gt;  55:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum56"&gt;  56:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; Route MapRoute(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; RouteCollection routes, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; name, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; url, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; physicalFile, &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; defaults, &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; constraints)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum57"&gt;  57:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum58"&gt;  58:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; routes.MapRoute(name, url, physicalFile,  defaults, constraints, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum59"&gt;  59:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum60"&gt;  60:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum61"&gt;  61:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; Route MapRoute(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; RouteCollection routes, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; name, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; url, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; physicalFile, &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; defaults, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] namespaces)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum62"&gt;  62:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum63"&gt;  63:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; routes.MapRoute(name, url, physicalFile,  defaults, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, namespaces);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum64"&gt;  64:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum65"&gt;  65:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum66"&gt;  66:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; Route MapRoute(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; RouteCollection routes, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; name, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; url, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; physicalFile, &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; defaults, &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; constraints, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] namespaces)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum67"&gt;  67:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum68"&gt;  68:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (routes == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum69"&gt;  69:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum70"&gt;  70:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ArgumentNullException(&lt;span style="color: #006080"&gt;"routes"&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum71"&gt;  71:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum72"&gt;  72:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (url == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum73"&gt;  73:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum74"&gt;  74:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ArgumentNullException(&lt;span style="color: #006080"&gt;"url"&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum75"&gt;  75:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum76"&gt;  76:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (physicalFile == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum77"&gt;  77:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum78"&gt;  78:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ArgumentNullException(&lt;span style="color: #006080"&gt;"physicalfile"&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum79"&gt;  79:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum80"&gt;  80:&lt;/span&gt;             Route route2 = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Route(url, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; PageRouteHandler(physicalFile));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum81"&gt;  81:&lt;/span&gt;             route2.Defaults = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RouteValueDictionary(defaults);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum82"&gt;  82:&lt;/span&gt;             route2.Constraints = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RouteValueDictionary(constraints);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum83"&gt;  83:&lt;/span&gt;             Route item = route2;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum84"&gt;  84:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ((namespaces != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) &amp;amp;&amp;amp; (namespaces.Length &amp;gt; 0))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum85"&gt;  85:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum86"&gt;  86:&lt;/span&gt;                 item.DataTokens = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RouteValueDictionary();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum87"&gt;  87:&lt;/span&gt;                 item.DataTokens[&lt;span style="color: #006080"&gt;"Namespaces"&lt;/span&gt;] = namespaces;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum88"&gt;  88:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum89"&gt;  89:&lt;/span&gt;             routes.Add(name, item);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum90"&gt;  90:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; item;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum91"&gt;  91:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum92"&gt;  92:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum93"&gt;  93:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// Nested Types&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum94"&gt;  94:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;sealed&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; IgnoreRouteInternal : Route&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum95"&gt;  95:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum96"&gt;  96:&lt;/span&gt;             &lt;span style="color: #008000"&gt;// Methods&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum97"&gt;  97:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; IgnoreRouteInternal(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; url)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum98"&gt;  98:&lt;/span&gt;                 : &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;(url, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; StopRoutingHandler())&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum99"&gt;  99:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum100"&gt; 100:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum101"&gt; 101:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum102"&gt; 102:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; VirtualPathData GetVirtualPath(RequestContext requestContext, RouteValueDictionary routeValues)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum103"&gt; 103:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum104"&gt; 104:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum105"&gt; 105:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum106"&gt; 106:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum107"&gt; 107:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum108"&gt; 108:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;So, how do you use these methods?&lt;/p&gt;

&lt;p&gt;These extensions add a few simple methods:&lt;/p&gt;

&lt;h3&gt;MapRoute&lt;/h3&gt;

&lt;p&gt;Stolen shamelessly from MVC. These methods provide a shortcut to defining Routes for WebForms.&lt;/p&gt;

&lt;p&gt;&lt;font face="Lucida Console"&gt;RouteCollection.MapRoute(string name, string url, string physicalFile);&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;For example to map a simple route you can now do:&lt;/p&gt;

&lt;p&gt;RouteTable.Routes.MapRoute(“ProductDetailsRoute”, “products/{productid}”, “~/ProductDetails.aspx”);&lt;/p&gt;

&lt;p&gt;Also has a couple of variants allowing for defining defaults etc…&lt;/p&gt;

&lt;p&gt;&lt;font face="Lucida Console"&gt;RouteCollection.MapRoute(string name, string url, string physicalFile, object defaults);&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font face="Lucida Console"&gt;RouteCollection.MapRoute(string name, string url, string physicalFile, object defaults, string[] namespaces);&lt;/font&gt;&lt;/p&gt;

&lt;h3&gt;GetRouteForUrl&lt;/h3&gt;

&lt;p&gt;&lt;font face="Lucida Console"&gt;Page.GetUrlForRoute(string routeName, RouteValueDictionary parameters);&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;Using a specifically named route and RouteValueDictionary containing a number of parameters will give you back a string containing the Url to use. REALLY useful in databound apps!&lt;/p&gt;

&lt;p&gt;e.g., &lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:hyperlink&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="HyperLink1"&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;NavigateUrl&lt;/span&gt;&lt;span style="color: #0000ff"&gt;='&amp;lt;%# Page.GetUrlForRoute("ProductDetailsRoute",new RouteValueDictionary( new {productid= Eval("ProductID")}))%&amp;gt;'&lt;/span&gt;  &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Details"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:hyperlink&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Page.GetUrlForRoute(RouteValueDictionary parameters);&lt;/p&gt;

&lt;p&gt;Same thing, but auto-matches the RouteValueDictionary parameters against a route…&lt;/p&gt;

&lt;h3&gt;IgnoreRoute&lt;/h3&gt;

&lt;p&gt;Allows you to define urls which should not be tried for matches against routes (can be useful for upgrading WebForms apps)&lt;/p&gt;

&lt;p&gt;RouteCollection.IgnoreRoute(string url);&lt;/p&gt;

&lt;p&gt;RouteCollection.IgnoreRoute(string url, object constraints);&lt;/p&gt;&lt;img src="http://mostlylucid.net/aggbug/1322.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Galloway</dc:creator>
            <guid>http://mostlylucid.net/archive/2009/05/19/1322.aspx</guid>
            <pubDate>Tue, 19 May 2009 20:23:41 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2009/05/19/1322.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/1322.aspx</wfw:commentRss>
        </item>
        <item>
            <title>The strange case of the disappearing Feature: AdapterGroup</title>
            <link>http://mostlylucid.net/archive/2009/04/27/1319.aspx</link>
            <description>&lt;p&gt;&lt;strong&gt;AdapterGroups are in Beta 1 but will (likely) not be in Beta 2 of ASP.NET 4.0&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This week I have the job of removing a feature which I originally designed for ASP.NET 4.0. This feature is ‘AdapterGroups’, so what is it?&lt;/p&gt;  &lt;p&gt;As you may be aware ASP.NET has a capability which allows switching how a control is rendered based on the capabilities of the browser the user makes the request for an ASPX page using. One of the ways this using a feature called Control Adapters. Even though these were originally designed to support mobile browsers, one of the most common uses for them right now is to ‘fix up’ the markup which many of our controls render using the &lt;a href="http://www.asp.net/CssAdapters/default.aspx"&gt;CSS Control Adapters&lt;/a&gt;, these in essence modify the code which specific controls (those with adapters) use to render their output. See &lt;a href="http://weblogs.asp.net/scottgu/archive/2006/11/29/tip-trick-use-the-asp-net-2-0-css-control-adapters-for-css-friendly-html-output.aspx"&gt;Scott Guthrie’s post&lt;/a&gt; as well as the &lt;a href="http://www.asp.net/CssAdapters/default.aspx"&gt;original whitepaper&lt;/a&gt; on how these work; oh, and of course &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163543.aspx"&gt;Fritz Onion’s great article&lt;/a&gt; on the topic.     &lt;br /&gt;So, by now you should see that Control Adapters can be pretty handy when you need to replace the default rendering which our controls provide to be more CSS compliant (or, whatever else you have an adapter for…). One of our big pushes in ASP.NET 4.0 is to improve how controls by default work with CSS; and we’re making a number of changes to the controls themselves to make this happen.    &lt;br /&gt;Originally the plan was to use the &lt;a href="http://www.asp.net/CssAdapters/default.aspx"&gt;CSS Control Adapters&lt;/a&gt; for this, but they had some problems:&lt;/p&gt;  &lt;p&gt;1. They’re potentially hard to configure. You have to understand how to use browser files (remember, the original use was for switching markup for mobile devices) &lt;/p&gt;  &lt;p&gt;For example, to change a single adapter on a specific control &lt;strong&gt;type&lt;/strong&gt;, you’d have to create an App_Browsers directory in your app then create a new *.browser file and enter it’s contents, pointing to the adapter you have created (or dropped the dll ofg into your bin directory). This sample is taken from &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163543.aspx"&gt;Fritz Onion’s MSDN article&lt;/a&gt;&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;browsers&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;browser&lt;/span&gt; &lt;span style="color: #ff0000"&gt;refID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Default"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;controlAdapters&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;       &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;adapter&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         &lt;span style="color: #ff0000"&gt;controlType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="System.Web.UI.WebControls.BulletedList"&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;         &lt;span style="color: #ff0000"&gt;adapterType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="MsdnMagazine.BulletedListControlAdapter"&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;       &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;controlAdapters&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;browser&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;browsers&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;
  &lt;br /&gt;2. you can only configure these by control for a whole site at a time (want to change just the one you have problems with, well…tough!)

  &lt;br /&gt;Number two is where AdapterGroup came in…the idea being that if you wanted to use one of the &lt;a href="http://www.asp.net/CssAdapters/default.aspx"&gt;CSS Control Adapters&lt;/a&gt; for just one specific page / one specific control with which you were having problems, well you could just do this:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &amp;lt;%@ Page Language=&lt;span style="color: #006080"&gt;"C#"&lt;/span&gt; AutoEventWireup=&lt;span style="color: #006080"&gt;"true"&lt;/span&gt;  CodeFile=&lt;span style="color: #006080"&gt;"Default.aspx.cs"&lt;/span&gt; Inherits=&lt;span style="color: #006080"&gt;"_Default"&lt;/span&gt; AdapterGroup=&lt;span style="color: #006080"&gt;"CSSAdapterGroup"&lt;/span&gt; %&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p /&gt;

&lt;p&gt;Notice in the above snippet that I’ve just set the AdapterGroup property for this page. This corresponds to a group defined in a *.browser file as follows:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;browsers&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;browser&lt;/span&gt; &lt;span style="color: #ff0000"&gt;refID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Default"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;controlAdapters&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;adapterGroup&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="CSSAdapterGroup"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;               &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;adapter&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;                 &lt;span style="color: #ff0000"&gt;controlType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="System.Web.UI.WebControls.BulletedList"&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;                 &lt;span style="color: #ff0000"&gt;adapterType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="MsdnMagazine.BulletedListControlAdapter"&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;               &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;controlAdapters&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;adapterGroup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;browser&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;browsers&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Notice, that we’ve identified a specific set (well, one in this case!) of Control Adapters as belonging to this specific adapter group. It’s also possible to set this at site (by specifying the defaultAdapterGroup attribute in the Page config element), as well as just for individual controls, e.g.,&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:Menu&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Menu1"&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;adapterGroup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="CSSAdapterGroup"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; ...&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:Menu&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Again, the idea being that if you wanted just to fix up a page  / control at a time to use specific adapters then this became possible.&lt;/p&gt;

&lt;p&gt;However, as the owner of the feature I was never able to sell the rest of the team on this concept. So, my task in the next few days is to have this feature removed before Beta 2 ships…well, I liked it :-) &lt;/p&gt;

&lt;p&gt;Thus ends the story of the disappearing feature… &lt;/p&gt;&lt;img src="http://mostlylucid.net/aggbug/1319.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Galloway</dc:creator>
            <guid>http://mostlylucid.net/archive/2009/04/27/1319.aspx</guid>
            <pubDate>Mon, 27 Apr 2009 16:07:58 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2009/04/27/1319.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/1319.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Back to life&amp;hellip;</title>
            <link>http://mostlylucid.net/archive/2009/03/27/1316.aspx</link>
            <description>&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:02fbe6a0-bbfc-42fa-b766-ed13c843a1b4" class="wlWriterEditableSmartContent"&gt;&lt;p&gt; &lt;a href="http://mostlylucid.net/images/mostlylucid_net/WindowsLiveWriter/Backtolife_8F39/TechDaysASP40Overview.pptx" target="_blank"&gt;TechDays MVC 4.0 Overview&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;       &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:aa65365c-475d-45ff-bdd8-7abdc209bd33" class="wlWriterEditableSmartContent"&gt;&lt;p&gt; &lt;a href="http://mostlylucid.net/images/mostlylucid_net/WindowsLiveWriter/Backtolife_8F39/TechDaysMVCSmart.pptx" target="_blank"&gt;TechDays MVC Presentation&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;  &lt;p&gt;Well, I’ve been back in the US for 5 days now, still really jet lagged but getting there; also managed to pick up a stomach bug at some point…Yes, I’m  a &lt;a href="http://en.wikipedia.org/wiki/Hypochondriasis"&gt;hypochondriac&lt;/a&gt;!&lt;/p&gt;  &lt;p&gt;The three weeks I spend travelling round Europe were really fun, I got to head home and see family for a couple of days as well as spend time in &lt;a href="http://en.wikipedia.org/wiki/Helsinki"&gt;Helsinki, Finland&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Antwerp"&gt;Antwerp, Belgium&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Vasteras"&gt;Vasteras, Sweden&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;The picture below is &lt;a href="http://blog.dotnetwiki.org/"&gt;Peli de Halleux&lt;/a&gt; and myself standing on the frozen Baltic Sea…which a few minutes before we’d been swimming in!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://mostlylucid.net/images/mostlylucid_net/WindowsLiveWriter/Backtolife_8F39/P3060024_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="P3060024" border="0" alt="P3060024" src="http://mostlylucid.net/images/mostlylucid_net/WindowsLiveWriter/Backtolife_8F39/P3060024_thumb.jpg" width="244" height="184" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The three &lt;a href="http://www.microsoft.com/belux/techdays/about.aspx"&gt;TechDays&lt;/a&gt; conferences (&lt;a href="http://search.twitter.com/search?q=%23techdays"&gt;twitter feed&lt;/a&gt;) were really fun, and my first chance to present to the people who use our products. I presented sessions on MVC as well as covering a lot of the stuff that’s in ASP.NET 4.0. By the end of the 6 talks (2 at each conference) I was pretty confident (always a challenger for me) and enjoying the experience.     &lt;br /&gt;Meeting our users is always fun, discovering how people are using our products and the problems they’re having (the &lt;a href="http://search.twitter.com/search?q=%23aspnetpain"&gt;#aspnetpain&lt;/a&gt; hashtag is partly the result of this). &lt;/p&gt;  &lt;p&gt;I also got a chance to spend some ‘quality time’ with our 4.0 features as well as MVC. Oddly, I don’t get to spend as much time using our stuff as I’d like (my work day is packed with toommuch other stuff). Using our new &lt;a href="http://www.mostlylucid.net/archive/2009/01/25/asp.net-4.0-webform-routing-quick-rsquon-dirty-version.aspx"&gt;WebForm Routing&lt;/a&gt; feature was a lot of fun; and gave me a bunch of ideas for making things easier (for example, currently it’s not great on DataBound controls; when Beta 1 rolls around I’ll post some extension methods here to make life easier). I also got to thinking a lot more about how people will advance their apps, maybe not to full MVC but a stepping stone to aid transition; using Routing, adopting an MVP pattern etc… &lt;/p&gt;  &lt;p&gt;Of course I also got tom play with the MVC framework; which is a really fun way to build apps (like many others I rolled my own MVC / MVP frameworks in the past). The new scaffolding functionality &lt;a href="http://www.haacked.com"&gt;Phil&lt;/a&gt; and the team added in RC1 really moves this framework to a whole different level for beginners. Frankly if I were building an app nowadays, I’d use MVC…&lt;/p&gt;  &lt;p&gt;Anyway, now I’m back and catching up on work, always a lot to do…&lt;/p&gt;  &lt;p&gt;NOTE: The PPTs at the top of the post presentations from TechDays, if you want to use them for anything, feel free! (The speaker notes in the first one are kinda rough, please don’t take them as ‘the official word!’&lt;/p&gt;&lt;img src="http://mostlylucid.net/aggbug/1316.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Galloway</dc:creator>
            <guid>http://mostlylucid.net/archive/2009/03/27/1316.aspx</guid>
            <pubDate>Fri, 27 Mar 2009 17:11:25 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2009/03/27/1316.aspx#feedback</comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/1316.aspx</wfw:commentRss>
        </item>
        <item>
            <title>ASP.NET 4.0: Page.MetaKeywords and Page.MetaDescription simple, but useful!</title>
            <link>http://mostlylucid.net/archive/2009/01/29/1313.aspx</link>
            <description>&lt;p&gt;One of the smaller additions we’ve made to ASP.NET 4.0 WebForms is the addition of two properties on the Page class, &lt;strong&gt;Page.MetaKeywords&lt;/strong&gt; and &lt;strong&gt;Page.MetaDescription.      &lt;br /&gt;&lt;/strong&gt;What these two properties do is provide access to / create meta tags within your  page as follows:&lt;/p&gt;  &lt;p&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;head&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;title&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;Untitled Page&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;title&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;strong&gt;    &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;meta&lt;/span&gt; &lt;span style="color: red"&gt;name&lt;/span&gt;&lt;span style="color: blue"&gt;="keywords"&lt;/span&gt; &lt;span style="color: red"&gt;content&lt;/span&gt;&lt;span style="color: blue"&gt;="These, are, my, keywords'&lt;/span&gt; &lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;strong&gt;    &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;meta&lt;/span&gt; &lt;span style="color: red"&gt;name&lt;/span&gt;&lt;span style="color: blue"&gt;="description"&lt;/span&gt; &lt;span style="color: red"&gt;content&lt;/span&gt;&lt;span style="color: blue"&gt;="This is the description of my page"&lt;/span&gt; &lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;head&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Simple, right? In fact these two properties work the same way as &lt;strong&gt;Page.Title&lt;/strong&gt; works:&lt;/p&gt;  &lt;p&gt;1. If there are no meta tags in the head element matching the property names e.g., name=”keywords” for &lt;strong&gt;Page.MetaKeywords&lt;/strong&gt; and name=”description” for &lt;strong&gt;Page.MetaDescription&lt;/strong&gt; then we create these tags and fill in the string you entered as the content.     &lt;br /&gt;2. If there are already meta tags with these names we provide get / set access to the existing tags…&lt;/p&gt;  &lt;p&gt;Of course you can set these in code, so the content could come from a DB to describe what you particular page is for etc…&lt;/p&gt;  &lt;p&gt;Oh, and you can also set these in the Page tag at the top of your WebForm as follows:&lt;/p&gt;  &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;@&lt;/span&gt; &lt;span style="color: #a31515"&gt;Page&lt;/span&gt; &lt;span style="color: red"&gt;Language&lt;/span&gt;&lt;span style="color: blue"&gt;="C#"&lt;/span&gt; &lt;span style="color: red"&gt;AutoEventWireup&lt;/span&gt;&lt;span style="color: blue"&gt;="true"&lt;/span&gt;  &lt;span style="color: red"&gt;CodeFile&lt;/span&gt;&lt;span style="color: blue"&gt;="Default.aspx.cs"&lt;/span&gt; &lt;span style="color: red"&gt;Inherits&lt;/span&gt;&lt;span style="color: blue"&gt;="_Default"&lt;/span&gt; Meta&lt;span style="color: red"&gt;eywords&lt;/span&gt;&lt;span style="color: blue"&gt;="Hello"&lt;/span&gt; &lt;span style="color: red"&gt;MetaDescription&lt;/span&gt;&lt;span style="color: blue"&gt;="This is my description"&lt;/span&gt; &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p /&gt;  &lt;p&gt;This will override the meta tag contents (if any) already declared in the page.&lt;/p&gt;  &lt;p&gt;Note, that the description in these tags is only really used for &lt;a href="http://googlewebmastercentral.blogspot.com/2007/09/improve-snippets-with-meta-description.html"&gt;improving your snippets on Google&lt;/a&gt;, Google and Live don’t use the Keywords for anything but &lt;a href="http://www.searchengineguide.com/richard-ball/meta-keywords-a.php"&gt;other search engines may&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;A simple feature but it is pretty useful (and saves you messing about with adding these manually / writing your own code to create these.&lt;/p&gt;&lt;img src="http://mostlylucid.net/aggbug/1313.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Galloway</dc:creator>
            <guid>http://mostlylucid.net/archive/2009/01/29/1313.aspx</guid>
            <pubDate>Thu, 29 Jan 2009 15:49:47 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2009/01/29/1313.aspx#feedback</comments>
            <slash:comments>6</slash:comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/1313.aspx</wfw:commentRss>
        </item>
        <item>
            <title>ASP.NET 4.0: ViewStateMode&amp;hellip;giving you more control over ViewState!</title>
            <link>http://mostlylucid.net/archive/2009/01/28/1312.aspx</link>
            <description>&lt;span class="cb1" /&gt;&lt;span class="cb1" /&gt;&lt;span class="cb1" /&gt;&lt;span class="cb1" /&gt;&lt;span class="cb1" /&gt;  &lt;p&gt;&lt;span class="cb1"&gt;ViewState is a pain…there, I’ve said it! What causes the most pain with ViewState is the fact that people misuse it a lot, leaving it enabled for every control in  a page when in fact you only really need it for that one control which really needs to persist it’s contents to the next page. &lt;a href="http://weblogs.asp.net/infinitiesloop/"&gt;Dave Reed&lt;/a&gt; a developer on the ASP.NET team has written a truly epic post on &lt;a href="http://weblogs.asp.net/infinitiesloop/archive/2006/08/03/Truly-Understanding-Viewstate.aspx"&gt;‘Truly Understanding ViewState’&lt;/a&gt;, and before you read what comes next, you really should head off and read that first…&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="cb1"&gt;Back? &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="cb1"&gt;Ok, well now you understand that you should only use ViewState for those controls that actually need it. But there’s a problem…what you’d really like to do is turn off ViewState for an entire page then just turn it on again for &lt;strong&gt;the controls that need it, &lt;/strong&gt;sorry but I have some bad news, you can’t do this in any version of ASP.NET up to and including ASP.NET 3.5 SP1. I also have some good news…you will be able to do this when ASP.NET 4.0 comes out! The magic little property on all ASP.NET Controls which lets you do this  is called ViewStateMode. (Incidentally, this was &lt;a href="http://weblogs.asp.net/infinitiesloop/"&gt;Dave’s&lt;/a&gt; idea and the samples below are a shameless rip-off from him :-))&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="cb1"&gt;Put very simply, ViewStateMode has 3 possible values, &lt;strong&gt;Enabled&lt;/strong&gt;, &lt;strong&gt;Disabled&lt;/strong&gt; and &lt;strong&gt;Inherit&lt;/strong&gt;. Which are pretty obvious in their function…&lt;strong&gt;Enabled&lt;/strong&gt; turns saving ViewState on for that control (or any child controls which are set as ‘Inherit’ or have nothing set), &lt;strong&gt;Disabled&lt;/strong&gt; turns it off again, and &lt;strong&gt;Inherit&lt;/strong&gt; says ‘use whatever my parent is set to’. That’s really all there is to it!&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="cb1"&gt;Here’s a very simple sample of how this actually works:&lt;/span&gt;    &lt;/p&gt;  &lt;div style="font-size: 10pt; background: white; color: black; font-family: courier new"&gt;   &lt;p style="margin: 0px"&gt;   &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;form&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="form1"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;&lt;/span&gt;    &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;script&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=”server”&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; OnLoad(&lt;span style="color: #2b91af"&gt;EventArgs&lt;/span&gt; e) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;if&lt;/span&gt; (!IsPostBack) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            label1.Text = label2.Text = &lt;span style="color: #a31515"&gt;"[DynamicValue]"&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;base&lt;/span&gt;.OnLoad(e);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;script&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaceHolder&lt;/span&gt; &lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="PlaceHolder1"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;ViewStateMode&lt;/span&gt;&lt;span style="color: blue"&gt;="Disabled"&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    Disabled: &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;Label&lt;/span&gt; &lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="label1"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;="[DeclaredValue]"&lt;/span&gt; &lt;span style="color: blue"&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;br&lt;/span&gt; &lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaceHolder&lt;/span&gt; &lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="PlaceHolder2"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;ViewStateMode&lt;/span&gt;&lt;span style="color: blue"&gt;="Enabled"&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        Enabled: &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;Label&lt;/span&gt; &lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="label2"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;="[DeclaredValue]"&lt;/span&gt; &lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaceHolder&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaceHolder&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;hr&lt;/span&gt; &lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;button&lt;/span&gt; &lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="Button1"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;="Postback"&lt;/span&gt; &lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt; &lt;span class="cb1" /&gt;  &lt;p&gt;As you can see in this sample we’re Disabling ViewState for the PlaceHolder1 control, the child label1 Inherits this property (as Inherit is default) and therefore saves no ViewState…In PlaceHolder2 we set ViewStateMode to ‘Enabled’, which leads to label2  inheriting this property and therefore saves ViewState…On the first page load we set both labels to the output the text [DynamicValue]…&lt;/p&gt;  &lt;p&gt;The effect of all this is that, when the Page first loads you see the labels rendered as follows:&lt;/p&gt;  &lt;p&gt;Disabled: [DynamicValue] &lt;/p&gt;  &lt;p&gt;Enabled: [DynamicValue]&lt;/p&gt;  &lt;p&gt;But, do a PostBack and you see:&lt;/p&gt;  &lt;p&gt;Disabled: [DeclaredValue] &lt;/p&gt;  &lt;p&gt;Enabled: [DynamicValue] &lt;/p&gt;  &lt;p&gt;As you’d now expect, the first label hasn’t preserved the value we set into ViewState…the second label has!&lt;/p&gt;  &lt;p&gt;What’s really cool is the fact that you can also do this:&lt;/p&gt;  &lt;div style="font-size: 10pt; background: white; color: black; font-family: courier new"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;@&lt;/span&gt; &lt;span style="color: #a31515"&gt;Page&lt;/span&gt; &lt;span style="color: red"&gt;Language&lt;/span&gt;&lt;span style="color: blue"&gt;="C#"&lt;/span&gt; &lt;span style="color: red"&gt;AutoEventWireup&lt;/span&gt;&lt;span style="color: blue"&gt;="true"&lt;/span&gt; &lt;span style="color: red"&gt;CodeBehind&lt;/span&gt;&lt;span style="color: blue"&gt;="Default.aspx.cs"&lt;/span&gt; &lt;span style="color: red"&gt;Inherits&lt;/span&gt;&lt;span style="color: blue"&gt;="WebApplication1._Default"&lt;/span&gt; &lt;span style="color: red"&gt;ViewStateMode&lt;/span&gt;&lt;span style="color: blue"&gt;="Disabled"&lt;/span&gt; &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Remember, in WebForms Page is just another control…it acts as the parent control for every other control in the page. This means that no control will save ViewState &lt;strong&gt;unless you set ViewStateMode to Enabled&lt;/strong&gt; for that control or a control further up it’s control hierarchy (so, a great use would be for ContentPlaceHolders in MasterPages…).&lt;/p&gt;  &lt;p&gt;Told you it was simple!&lt;/p&gt;&lt;img src="http://mostlylucid.net/aggbug/1312.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Galloway</dc:creator>
            <guid>http://mostlylucid.net/archive/2009/01/28/1312.aspx</guid>
            <pubDate>Wed, 28 Jan 2009 15:55:26 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2009/01/28/1312.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/1312.aspx</wfw:commentRss>
        </item>
        <item>
            <title>ASP.NET 4.0: Browser Capabilities Providers (esoterica warning!)</title>
            <link>http://mostlylucid.net/archive/2009/01/26/asp.net-4.0-browser-capabilities-providers-esoterica-warning.aspx</link>
            <description>&lt;p&gt;ASP.NET determines the capabilities of the browser with which a user is browsing your site using a feature called ‘browser capabilities’. In ASP.NET 3.5 SP1 there are two main ways in which you can define the capabilities which a browser has:&lt;/p&gt;
&lt;p&gt;1. To make the change for your entire machine. Go into C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers, find the browser you want to alter, find the specific capability you want to alter in the XML, change it then run aspnet_regbrowsers.exe –I from the VS Tools command line to rebuild the Browser Capabilities assembly and add it to the GAC…&lt;/p&gt;
&lt;p&gt;2. To make a change for just a specific application. Add a *.browser file into a folder called app_browsers within your application which specifies the browser (or default) to which you want to apply these capabilities.&lt;/p&gt;
&lt;p&gt;As so can see, both of these approaches are pretty limited, in that you really have to change XML files ; and in the first case, you have to restart your app as part of the aspnet_regbrowsers.exe process. In ASP.NET 4.0 we have added a feature called BrowserCapabilities Providers which, as the name suggests, allows you to build a provider allowing you to use your own code to determine Browser Capabilities from your own data store.&lt;/p&gt;
&lt;p&gt;Why would you want to do this, well, browser files are notoriously hard to update (the ASP.NET team really hasn’t touched them since ASP.NET 2.0), they’re pretty complicated to work with and well…they’re a strange XML syntax. Wouldn’t it be cool if there was a common Browser Definition syntax, or a database containing a huge number of new browser definitions…or even a web service. Before you really couldn’t use any of this with ASP.NET…now you can :-)&lt;/p&gt;
&lt;p&gt;So, how do you use the new ASP.NET 4.0 Browser Capabilities Provider feature?&lt;/p&gt;
&lt;p&gt;There are two main possibilities here, extend the ASP.NET Browser Capabilities definition functionality or totally replace it. &lt;/p&gt;
&lt;p&gt;To replace the ASP.NET Browser Capabilities definition functionality:&lt;/p&gt;
&lt;p&gt;1. Create a provider by sub-classing the &lt;em&gt;HttpCapabilitiesProvider:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;public class CustomProvider : HttpCapabilitiesProvider&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;public override HttpBrowserCapabilities&lt;/p&gt;
&lt;p&gt;GetBrowserCapabilities(HttpRequest request)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;HttpBrowserCapabilities browserCaps = new &lt;/p&gt;
&lt;p&gt;HttpBrowserCapabilities();&lt;/p&gt;
&lt;p&gt;Hashtable values = new Hashtable(180, &lt;/p&gt;
&lt;p&gt;StringComparer.OrdinalIgnoreCase);&lt;/p&gt;
&lt;p&gt;values[String.Empty] = request.UserAgent;&lt;/p&gt;
&lt;p&gt;values["browser"] = "MyCustomBrowser";&lt;/p&gt;
&lt;p&gt;browserCaps.Capabilities = values;&lt;/p&gt;
&lt;p&gt;return browserCaps;&lt;/p&gt;
&lt;p&gt;} &lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;In this example we create a new &lt;em&gt;HttpBrowserCapabilities&lt;/em&gt; object, specifying only the capability ‘browser’ to value ‘MyCustomBrowser’.&lt;/p&gt;
&lt;p&gt;2. Register the provider with the application.&lt;/p&gt;
&lt;p&gt;In order to use a provider within an application, you need to add the provider attribute to the &lt;em&gt;browserCaps&lt;/em&gt; section in &lt;em&gt;Web.config&lt;/em&gt; or &lt;em&gt;Machine.config&lt;/em&gt;, &lt;br /&gt;
&lt;strong&gt;note&lt;/strong&gt;: it is also possible to define this within a &lt;em&gt;&amp;lt;location&amp;gt;&lt;/em&gt; tag for specific directories within the app; e.g., a specific mobile directory.&lt;/p&gt;
&lt;p&gt;&amp;lt;system.web&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;browserCaps provider="ClassLibrary2.CustomProvider, ClassLibrary2, &lt;/p&gt;
&lt;p&gt;Version=1.0.0.0, Culture=neutral" /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/system.web&amp;gt;&lt;/p&gt;
&lt;p&gt;Another way to ‘plug in’ the new BrowserCapabilities is to use code:&lt;/p&gt;
&lt;p&gt;void Application_Start(object sender, EventArgs e) &lt;br /&gt;
{ &lt;br /&gt;
HttpCapabilitiesBase.BrowserCapabilitiesProvider = &lt;br /&gt;
new ClassLibrary2.CustomProvider(); &lt;br /&gt;
.. &lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: This must be run in the Application_Start event as changing the &lt;em&gt;BrowserProvider&lt;/em&gt; must happen before the first executes to ensure the cache remains in a valid state for the resolved &lt;em&gt;HttpCapabilitiesBase&lt;/em&gt; object.&lt;/p&gt;
&lt;h6&gt;Adding Caching&lt;/h6&gt;
&lt;p&gt;The previous example has one major problem; this code would run on each call to get the HttpBrowserCapabilities which can happen multiple times in each request. For the example above it’s not really a big deal as we don’t really do much, but you can imagine that if your code does some significant work then this can be a huge overhead. So, how would you prevent this happening? Cache the &lt;em&gt;HttpBrowserCapabilities&lt;/em&gt; object! &lt;/p&gt;
&lt;p&gt;1. Again, create a provider by sub-classing the &lt;em&gt;HttpCapabilitiesProvider:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;public class CustomProvider : HttpCapabilitiesProvider&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;public override HttpBrowserCapabilities &lt;/p&gt;
&lt;p&gt;GetBrowserCapabilities(HttpRequest request)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;string cacheKey = BuildCacheKey();&lt;/p&gt;
&lt;p&gt;int cacheTime = GetCacheTime();&lt;/p&gt;
&lt;p&gt;HttpBrowserCapabilities browserCaps =&lt;/p&gt;
&lt;p&gt;HttpContext.Current.Cache[cacheKey] as &lt;/p&gt;
&lt;p&gt;HttpBrowserCapabilities;&lt;/p&gt;
&lt;p&gt;If (browserCaps == null)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;HttpBrowserCapabilities browserCaps = new &lt;/p&gt;
&lt;p&gt;HttpBrowserCapabilities();&lt;/p&gt;
&lt;p&gt;Hashtable values = new Hashtable(180, &lt;/p&gt;
&lt;p&gt;StringComparer.OrdinalIgnoreCase);&lt;/p&gt;
&lt;p&gt;values[String.Empty] = request.UserAgent;&lt;/p&gt;
&lt;p&gt;values["browser"] = "MyCustomBrowser";&lt;/p&gt;
&lt;p&gt;browserCaps.Capabilities = values;&lt;/p&gt;
&lt;p&gt;HttpContext.Current.Cache.Insert(cacheKey, &lt;/p&gt;
&lt;p&gt;browserCaps, null, DateTime.MaxValue, &lt;/p&gt;
&lt;p&gt;TimeSpan.FromSeconds(cacheTime));&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;return browserCaps;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;} &lt;/p&gt;
&lt;p&gt;In the code above, in order to improve performance for each subsequent request we generate a cache key using their own &lt;em&gt;BuildCacheKey()&lt;/em&gt; as well as the length of time to cache returned from their own &lt;em&gt;GetCacheTime()&lt;/em&gt; method to enter the resolved &lt;em&gt;HttpBrowserCapabilities&lt;/em&gt; object into cache and can then reuse this object on subsequent requests with matching User Agent string.&lt;/p&gt;
&lt;p&gt;2. Register the provider with the application. See previous example.&lt;/p&gt;
&lt;h6&gt;Extending ASP.NET’s Browser Capabilities’ functionality&lt;/h6&gt;
&lt;p&gt;Great, so now we know how to create a new &lt;em&gt;HttpBrowserCapabilities&lt;/em&gt; object which ASP.NET 4.0 uses. What about extending ASP.NET’s Browser Capabilities functionality by adding new Browser Capabilities definitions to those ASP.NET currently ships with…WITHOUT using the XML definitions we mentioned previously?&lt;/p&gt;
&lt;p&gt;1. To generate a Browser Capabilities Provider we create a class inheriting from the &lt;em&gt;HttpCapabilitiesDefaultProvider &lt;/em&gt;as follows:&lt;/p&gt;
&lt;p&gt;public class CustomProvider : HttpCapabilitiesDefaultProvider&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;public override HttpBrowserCapabilities &lt;/p&gt;
&lt;p&gt;GetBrowserCapabilities(HttpRequest request)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;HttpBrowserCapabilities browserCaps = &lt;/p&gt;
&lt;p&gt;base.GetHttpBrowserCapabilities(request);&lt;/p&gt;
&lt;p&gt;if (browserCaps.Browser == "Unknown")&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;browserCaps = MyBrowserCapabilitiesEvaulator(request);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;return browserCaps;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Here we first use ASP.NET’s Browser Capabilities functionality to try and identify the browser, however if no browser was identified based on the information defined in the request. In this code, we check for the browser being unidentified by checking for the string “Unknown’ in the &lt;em&gt;HttpBrowserCapabilities.Browser&lt;/em&gt; property and then we call into our own code (&lt;em&gt;MyBrowserCapabilitiesEvaluator&lt;/em&gt;) to identify the correct browser using the information contained in the request.&lt;/p&gt;
&lt;p&gt;3. Register the provider with the application. See the first example.&lt;/p&gt;
&lt;h6&gt;Adding new Capabilities to Existing Browser Capabilities Definitions&lt;/h6&gt;
&lt;p&gt;1. To generate a Browser Capabilities Provider the developer would create a class inheriting from the HttpCapabilitiesEvaluator as follows:&lt;/p&gt;
&lt;p&gt;public class CustomProvider : HttpCapabilitiesDefaultProvider&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;public override HttpBrowserCapabilities &lt;/p&gt;
&lt;p&gt;GetBrowserCapabilities(HttpRequest request)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;HttpBrowserCapabilities browserCaps = &lt;/p&gt;
&lt;p&gt;base.GetHttpBrowserCapabilities(request);&lt;/p&gt;
&lt;p&gt;browserCaps.Frames = true;&lt;/p&gt;
&lt;p&gt;browserCaps.Capabilities["MyCapability"] = "Bob";&lt;/p&gt;
&lt;p&gt;return browserCaps;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;In this case we have extended the shipped HttpCapabilitiesDefaultProvider class and obtained the &lt;em&gt;HttpBrowserCapabilities&lt;/em&gt; object which the base method returns:&lt;/p&gt;
&lt;p&gt;HttpBrowserCapabilities browserCaps = &lt;/p&gt;
&lt;p&gt;base.GetHttpBrowserCapabilities(request);&lt;/p&gt;
&lt;p&gt;By accessing the base method we are able to access the existing &lt;em&gt;HttpBrowserCapabilities&lt;/em&gt; definition and add / modify a capability for this browser in their own code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: There are two ways of specifying a browser capability:&lt;/p&gt;
&lt;p&gt;1. The &lt;em&gt;HttpCapabilitiesBase&lt;/em&gt; object contains an &lt;em&gt;IDictionary&lt;/em&gt; names ‘&lt;em&gt;Capabilities’&lt;/em&gt;, the developer can add any value to this discionary e.g, in this case adding a capability called ‘MyCapability’ with the value ‘Bob’. &lt;/p&gt;
&lt;p&gt;2. The second is through the use of properties on the &lt;em&gt;HttpCapabilitiesBase&lt;/em&gt; object, in the case above the developer sets the value of ‘Frames’ to ‘true’; in reality this is in fact an accessor for the &lt;em&gt;Capabilities&lt;/em&gt; &lt;em&gt;IDictionary&lt;/em&gt; and adds / retrieves this property from that &lt;em&gt;IDictionary&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Note: This model applies to any property of HttpBrowserCapabilities, including Control Adapters.&lt;/p&gt;
&lt;p&gt;2. Register the provider with the application. See the first example…&lt;/p&gt;&lt;img src="http://mostlylucid.net/aggbug/1311.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Galloway</dc:creator>
            <guid>http://mostlylucid.net/archive/2009/01/26/asp.net-4.0-browser-capabilities-providers-esoterica-warning.aspx</guid>
            <pubDate>Mon, 26 Jan 2009 17:47:01 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2009/01/26/asp.net-4.0-browser-capabilities-providers-esoterica-warning.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/1311.aspx</wfw:commentRss>
        </item>
        <item>
            <title>ASP.NET 4.0: WebForm Routing (quick &amp;rsquo;n dirty version)</title>
            <link>http://mostlylucid.net/archive/2009/01/25/asp.net-4.0-webform-routing-quick-rsquon-dirty-version.aspx</link>
            <description>&lt;p align="left"&gt; &lt;/p&gt;  &lt;p align="left"&gt;NOTE: This is a quick introduction,. I’ll drill into this more in a future post.&lt;/p&gt;  &lt;p align="left"&gt;One of the things we’re adding in ASP.NET 4.0 is built-in support for using Routing together with WebForms. Now, I’m totally aware that this is possible to do already and that a number of people have &lt;a href="http://haacked.com/archive/2008/03/11/using-routing-with-webforms.aspx"&gt;posted ways of doing this&lt;/a&gt; with the Web Routing feature which shipped with ASP.NET 3.5 SP1. We’re just adding some features to make it easier to do…&lt;/p&gt;  &lt;p align="left"&gt;So, what are we adding?&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;     &lt;div align="left"&gt;WebFormRouteHandler, this is a simple HttpHandler which you use in defining your routes…it essentially takes care of passing data into the page you’re routing to. &lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;Adding HttpRequest.RequestContext and Page.RouteData (this is really just a proxy onto the HttpRequest.RequestContext.RouteData object). Makes it easier to access information passed from the Route. &lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;ExpressionBuilders: &lt;/div&gt;      &lt;ol&gt;       &lt;li&gt;         &lt;div align="left"&gt;RouteUrl (in System.Web.Compilation.RouteUrlExpressionBuilder), a simple way to create a URL corresponding to your route URL format within an ASP.NET Server Control &lt;/div&gt;       &lt;/li&gt;        &lt;li&gt;         &lt;div align="left"&gt;RouteValue (again, in System.Web.Compilation.RouteValueExpressionBuilder), a simple way to extract information from the RouteContext. &lt;/div&gt;       &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;RouteParameter, a DataSource parameter which lets you easily pass data contained in RouteContext into a query for a DataSource…like &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.formparameter.aspx"&gt;FormParameter&lt;/a&gt;. &lt;/div&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p align="left"&gt;So, how does all this fit together? &lt;/p&gt;  &lt;h3 align="left"&gt;WebFormRouteHandler&lt;/h3&gt;  &lt;p align="left"&gt;First, let’s define the new WebForm route…as follows:&lt;/p&gt;  &lt;p align="left"&gt; &lt;/p&gt;  &lt;div style="font-family: calibri; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Global&lt;/span&gt; : System.Web.HttpApplication &lt;/p&gt;    &lt;p style="margin: 0px"&gt;{ &lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; Application_Start(&lt;span style="color: blue"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af"&gt;EventArgs&lt;/span&gt; e) &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    { &lt;/p&gt;    &lt;p style="margin: 0px"&gt;        RouteTable.Routes.Add(&lt;span style="color: #a31515"&gt;"SearchRoute"&lt;/span&gt;, &lt;span style="color: blue"&gt;new&lt;/span&gt; Route(&lt;span style="color: #a31515"&gt;"search/{searchterm}"&lt;/span&gt;, &lt;span style="color: blue"&gt;new&lt;/span&gt; WebFormRouteHandler(&lt;span style="color: #a31515"&gt;"~/search.aspx"&lt;/span&gt;))); &lt;/p&gt;    &lt;p style="margin: 0px"&gt;        RouteTable.Routes.Add(&lt;span style="color: #a31515"&gt;"UserRoute"&lt;/span&gt;, &lt;span style="color: blue"&gt;new&lt;/span&gt; Route(&lt;span style="color: #a31515"&gt;"users/{username}"&lt;/span&gt;, &lt;span style="color: blue"&gt;new&lt;/span&gt; WebFormRouteHandler(&lt;span style="color: #a31515"&gt;"~/users.aspx"&lt;/span&gt;))); &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    } &lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt; &lt;/div&gt;  &lt;p align="left" /&gt;  &lt;p align="left"&gt;As you can see, we simply map the Route onto a physical page (in the first string, “~/search.aspx”), we’ve also said that the parameter ‘searchterm’ should be extracted from the URL and passed into the page. &lt;/p&gt;  &lt;p align="left"&gt;We also support an additional parameter for WebFormRouteHandler, the signature is as follows:&lt;/p&gt;  &lt;div style="font-family: calibri; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;WebFormRouteHandler(&lt;span style="color: blue"&gt;string&lt;/span&gt; virtualPath, &lt;span style="color: blue"&gt;bool&lt;/span&gt; checkPhysicalUrlAccess);&lt;/p&gt; &lt;/div&gt;  &lt;p align="left"&gt;The ‘checkPhysicalUrlAccess’ parameter specifies whether the RouteHandler should check the perrmissions for the &lt;em&gt;physical&lt;/em&gt; page you’re routing to (in the case above, search.aspx) as well as the incoming Url…this defaults to ‘true’.&lt;/p&gt;  &lt;h3 align="left"&gt;HttpRequest.RequestContext and Page.RouteData&lt;/h3&gt;  &lt;p align="left"&gt;Now that you’re in the physical page, how do you go about accessing the information which the Routing system has extracted from the Url (or, an object which some other object has added to the RouteData)?&lt;/p&gt;  &lt;p align="left"&gt;As I mentioned before, we’ve added two methods…HttpRequest.RequestContext and Page.RouteData. Where Page.RouteData is just a convenience method onto HttpRequest.RequestContext.RouteData&lt;/p&gt;  &lt;p align="left"&gt;This lets us do the following:&lt;/p&gt;  &lt;div style="font-family: calibri; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;   &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; Page_Load(&lt;span style="color: blue"&gt;object&lt;/span&gt; sender, EventArgs e) &lt;/p&gt;    &lt;p style="margin: 0px"&gt;      { &lt;/p&gt;    &lt;p style="margin: 0px"&gt;          &lt;span style="color: blue"&gt;string&lt;/span&gt; searchterm= Page.RouteData.Values[&lt;span style="color: #a31515"&gt;"searchterm"&lt;/span&gt;] &lt;span style="color: blue"&gt;as&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt;; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;          Response.Write(searchterm); &lt;/p&gt;    &lt;p style="margin: 0px"&gt;      }&lt;/p&gt; &lt;/div&gt;  &lt;p align="left"&gt;Here, we’re just extracting the value we passed in for ‘searchterm’ defined in the Route above.&lt;/p&gt;  &lt;p align="left"&gt;Given the url http://localhost/search/scott/ , this would output the word ‘scott’ into the page…&lt;/p&gt;  &lt;p align="left"&gt;So, nice…that’s how we’d do it in code…but what about Markup?&lt;/p&gt;  &lt;h3&gt;RouteUrl and RouteValue expression builders&lt;/h3&gt;  &lt;p align="left"&gt;ExpressionBuilders have been described as a &lt;a href="http://haacked.com/archive/2006/11/29/Express_Yourself_With_Custom_Expression_Builders.aspx"&gt;‘hidden gem of ASP.NET’&lt;/a&gt;, and that’s a shame…because they’re actually pretty cool. We’ve implemented two new expression builders for WebForm routing. They’re used as follows:&lt;/p&gt;  &lt;div style="font-family: calibri; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;HyperLink&lt;/span&gt; &lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="HyperLink1"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;NavigateUrl&lt;/span&gt;&lt;span style="color: blue"&gt;="&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;$RouteUrl:SearchTerm=Bob&lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;"&amp;gt;&lt;/span&gt;Link to search&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;HyperLink&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Here we’re using the RouteUrl expressionbuilder to work out our Url based on a route parameter…the reason for doing this is to save having to hard code in our Url structure into our markup…this of course lets us change the URL structure later.&lt;/p&gt;  &lt;p&gt;Based on the route we defined previously, this would generate the Url: ‘http://localhost/search/bob’, one thing to note is that we automatically work out the correct route based on the input parameters…you can also name the route in this expressionbuilder which lets you define  a specific route url definition to  use.&lt;/p&gt;  &lt;p&gt;RouteValue is used like so:&lt;/p&gt;  &lt;div style="font-family: calibri; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;Label&lt;/span&gt; &lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="Label1"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;="&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;$RouteValue:SearchTerm&lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;/span&gt; &lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Pretty simple right? Yes, but it avoids you having to mess around with the more complex Page.RouteData[“x”] in your markup…&lt;/p&gt;  &lt;p&gt;In this case we’d get the value ‘scott’ inserted into our label’s text element.&lt;/p&gt;  &lt;h3&gt;RouteParameter&lt;/h3&gt;  &lt;p&gt;Well, just use it like &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.formparameter.aspx"&gt;FormParameter&lt;/a&gt; e.g.,&lt;/p&gt;  &lt;div style="font-family: calibri; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;         &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;sqldatasource&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="SqlDataSource1"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt;  &lt;span style="color: red"&gt;connectionstring&lt;/span&gt;&lt;span style="color: blue"&gt;="&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;$ ConnectionStrings:MyNorthwind &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: red"&gt;selectcommand&lt;/span&gt;&lt;span style="color: blue"&gt;="SELECT CompanyName,ShipperID FROM Shippers where CompanyName=@companyname"&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;          &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;selectparameters&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;routeparameter&lt;/span&gt; &lt;span style="color: red"&gt;name&lt;/span&gt;&lt;span style="color: blue"&gt;="companyname"&lt;/span&gt; &lt;span style="color: red"&gt;RouteKey&lt;/span&gt;&lt;span style="color: blue"&gt;=”searchterm”&lt;/span&gt;  &lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;          &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;selectparameters&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;      &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;sqldatasource&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;I this case we extract the Route parameter ‘searchterm’ and pass it into the select statement.&lt;/p&gt;  &lt;p&gt;Well, that’s it for this whistle-stop tour of our new ASP.NET 4.0 WebForm routing feature…&lt;/p&gt;&lt;img src="http://mostlylucid.net/aggbug/1309.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Galloway</dc:creator>
            <guid>http://mostlylucid.net/archive/2009/01/25/asp.net-4.0-webform-routing-quick-rsquon-dirty-version.aspx</guid>
            <pubDate>Mon, 26 Jan 2009 02:13:58 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2009/01/25/asp.net-4.0-webform-routing-quick-rsquon-dirty-version.aspx#feedback</comments>
            <slash:comments>9</slash:comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/1309.aspx</wfw:commentRss>
        </item>
        <item>
            <title>ASP.NET 4.0: Way too much information on Control IDs and ASP.NET 4.0 Client Id Enhancements</title>
            <link>http://mostlylucid.net/archive/2008/11/03/way-too-much-information-on-control-ids-and-asp.net-4.0.aspx</link>
            <description>&lt;p&gt;Of of the ASP.NET enhancements which first made an appearance in the Visual Studio 2010 PDC CTP release  is the ability to set a client Id which you can be confident will be used when the control renders it’s markup.    &lt;br /&gt;All of the samples in this post will use the following Server Control:&lt;/p&gt;  &lt;p /&gt;  &lt;p /&gt;  &lt;p /&gt;  &lt;div style="font-family: calibri; background: white; color: black; font-size: 10pt"&gt;   &lt;div style="font-family: calibri; background: white; color: black; font-size: 10pt"&gt;     &lt;div style="font-family: calibri; background: white; color: black; font-size: 10pt"&gt;       &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; System.Web.UI;&lt;/p&gt;        &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; System.Web.UI.WebControls;&lt;/p&gt;        &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;namespace&lt;/span&gt; TestControls&lt;/p&gt;        &lt;p style="margin: 0px"&gt;{&lt;/p&gt;        &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;NamingPanel&lt;/span&gt; : &lt;span style="color: #2b91af"&gt;Panel&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;INamingContainer&lt;/span&gt;&lt;/p&gt;        &lt;p style="margin: 0px"&gt;    { }&lt;/p&gt;        &lt;p style="margin: 0px"&gt;}&lt;/p&gt;        &lt;p style="margin: 0px"&gt;    &lt;/p&gt;        &lt;p&gt;&lt;strong&gt;NamingPanel&lt;/strong&gt; is very simple server control which just enables us to see the effect of &lt;strong&gt;ClientId&lt;/strong&gt; without all the cruft that goes with using a more complex control (e.g, &lt;strong&gt;GridView&lt;/strong&gt;).&lt;/p&gt;        &lt;p&gt; &lt;/p&gt;        &lt;p align="center"&gt;Message from TestKing&lt;/p&gt;        &lt;p align="center"&gt;Testking offers the featured resources for providing &lt;a href="http://www.testking.com/MCITP-certification-training.htm"&gt;mcitp&lt;/a&gt; training , &lt;a href="http://www.testking.com/MCTS-certification-training.htm"&gt;mcts&lt;/a&gt; courses and &lt;a href="http://www.testking.com/A-plus-certification-training.htm"&gt;a+ certification&lt;/a&gt; materials.&lt;/p&gt;       &lt;font size="3"&gt;         &lt;h3&gt;How does the Control Id get defined now?&lt;/h3&gt;          &lt;p style="margin: 0px"&gt;&lt;font size="3" /&gt;            &lt;/p&gt;&lt;p&gt;When used with a ‘nested’ &lt;strong&gt;NamingPanel&lt;/strong&gt;, the following markup:&lt;/p&gt;            &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;             &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;NamingPanel&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="rootPanel"&amp;gt;&lt;/span&gt; &lt;/p&gt;              &lt;p style="margin: 0px"&gt;  &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;NamingPanel&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="childPanel1"&amp;gt;&lt;/span&gt; &lt;/p&gt;              &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBox&lt;/span&gt; &lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="TextBox"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;="Hello!"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBox&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;              &lt;p style="margin: 0px"&gt;  &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;NamingPanel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;              &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;NamingPanel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;           &lt;/div&gt;            &lt;p&gt;results in this rendered HTML:&lt;/p&gt;            &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;             &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;div&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="Div1"&amp;gt;&lt;/span&gt;  &lt;/p&gt;              &lt;p style="margin: 0px"&gt;  &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;div&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="rootPanel_childPanel1"&amp;gt;&lt;/span&gt; &lt;/p&gt;              &lt;p style="margin: 0px"&gt;     &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;input&lt;/span&gt; &lt;span style="color: red"&gt;name&lt;/span&gt;&lt;span style="color: blue"&gt;="rootPanel$childPanel1$TextBox"&lt;/span&gt; &lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;="text"&lt;/span&gt; &lt;span style="color: red"&gt;value&lt;/span&gt;&lt;span style="color: blue"&gt;="Hello!"&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="rootPanel_childPanel1_TextBox"&lt;/span&gt; &lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt; &lt;/p&gt;              &lt;p style="margin: 0px"&gt;  &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;div&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;              &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;div&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;           &lt;/div&gt;           &lt;font size="3"&gt;             &lt;p style="margin: 0px" /&gt;              &lt;p /&gt;           &lt;/font&gt;            &lt;p /&gt;            &lt;p&gt;As you can see the id “TextBox” defined in the original markup gets mangled to  preserve ‘uniqueness’ by including the Ids of it’s parent controls within it’s own id attribute. &lt;/p&gt;            &lt;p&gt;Whilst making the id attribute ‘unique’ does ensure that we can ensure that selecting a specific control client side using the id attribute will result in a single control, it does tend to get a bit verbose; the example above is only 2 levels deep, with more nesting; or even just using a control in  &lt;a href="http://msdn.microsoft.com/en-us/library/x2b3ktt7.aspx"&gt;Nested MasterPages&lt;/a&gt; can result in hugely long values for the Client Id…&lt;/p&gt;            &lt;p&gt;The second major problem with the ‘unique’ Client Ids is that you can’t guarantee that your client Id will remain the same if you move a control from one ‘NamingContainer’ to another.&lt;/p&gt;            &lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; A NamingContainer is a control which either directly or indirectly implements the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.inamingcontainer(VS.71).aspx"&gt;INamingContainer&lt;/a&gt; interface. In essence it defines a ‘NameSpace’ for controls…you’d most commonly implement this interface on &lt;a href="http://msdn.microsoft.com/en-us/library/aa719734(VS.71).aspx"&gt;Composite Server Controls&lt;/a&gt; to ensure that  any of the contained child controls are rendered with the parent ids prefixing their own Ids, ensuring they remain unique within the page.&lt;/p&gt;            &lt;p&gt;What happens if you don’t specify an ‘id’ for one of these parent controls in markup? Given the following markup:&lt;/p&gt;            &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;             &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;NamingPanel&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="rootPanel"&amp;gt;&lt;/span&gt; &lt;/p&gt;              &lt;p style="margin: 0px"&gt;  &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;NamingPanel&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;&lt;/span&gt; &lt;/p&gt;              &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBox&lt;/span&gt; &lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="TextBox1"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;="Hello!"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBox&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;              &lt;p style="margin: 0px"&gt;  &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;NamingPanel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;              &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;NamingPanel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;           &lt;/div&gt;            &lt;p&gt;results in this rendered HTML:&lt;/p&gt;            &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;             &lt;p style="margin: 0px"&gt;  &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;div&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="Div2"&amp;gt;&lt;/span&gt;&lt;/p&gt;              &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;div&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;              &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;input&lt;/span&gt; &lt;span style="color: red"&gt;name&lt;/span&gt;&lt;span style="color: blue"&gt;="rootPanel$ctl00$TextBox"&lt;/span&gt; &lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;="text"&lt;/span&gt; &lt;span style="color: red"&gt;value&lt;/span&gt;&lt;span style="color: blue"&gt;="Hello!"&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="rootPanel_ctl00_TextBox"&lt;/span&gt; &lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;              &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;div&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;              &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;div&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;           &lt;/div&gt;            &lt;p&gt;Taking a look at the id for the TextBox you can see that there’s an odd name inserted in the id attribute “ctl00”, where did this come form? Well, in the System.Web.UI.Control class there’s a declaration as follows (note, this and all other source in the post is from the ASP.NET 2.0 source using &lt;a href="http://www.red-gate.com/products/reflector/"&gt;Reflector&lt;/a&gt;):&lt;/p&gt;            &lt;div style="font-family: calibri; background: white; color: black; font-size: 10pt"&gt;             &lt;p style="margin: 0px"&gt;  &lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;readonly&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt;[] automaticIDs = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt;[] { &lt;/p&gt;              &lt;p style="margin: 0px"&gt;        &lt;span style="color: #a31515"&gt;"ctl00"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl01"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl02"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl03"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl04"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl05"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl06"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl07"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl08"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl09"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl10"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl11"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl12"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl13"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl14"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl15"&lt;/span&gt;, &lt;/p&gt;              &lt;p style="margin: 0px"&gt;        &lt;span style="color: #a31515"&gt;"ctl16"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl17"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl18"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl19"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl20"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl21"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl22"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl23"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl24"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl25"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl26"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl27"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl28"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl29"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl30"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl31"&lt;/span&gt;, &lt;/p&gt;              &lt;p style="margin: 0px"&gt;        &lt;span style="color: #a31515"&gt;"ctl32"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl33"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl34"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl35"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl36"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl37"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl38"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl39"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl40"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl41"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl42"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl43"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl44"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl45"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl46"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl47"&lt;/span&gt;, &lt;/p&gt;              &lt;p style="margin: 0px"&gt;        &lt;span style="color: #a31515"&gt;"ctl48"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl49"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl50"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl51"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl52"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl53"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl54"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl55"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl56"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl57"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl58"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl59"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl60"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl61"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl62"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl63"&lt;/span&gt;, &lt;/p&gt;              &lt;p style="margin: 0px"&gt;        &lt;span style="color: #a31515"&gt;"ctl64"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl65"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl66"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl67"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl68"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl69"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl70"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl71"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl72"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl73"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl74"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl75"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl76"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl77"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl78"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl79"&lt;/span&gt;, &lt;/p&gt;              &lt;p style="margin: 0px"&gt;        &lt;span style="color: #a31515"&gt;"ctl80"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl81"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl82"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl83"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl84"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl85"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl86"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl87"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl88"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl89"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl90"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl91"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl92"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl93"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl94"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl95"&lt;/span&gt;, &lt;/p&gt;              &lt;p style="margin: 0px"&gt;        &lt;span style="color: #a31515"&gt;"ctl96"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl97"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl98"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl99"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl100"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl101"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl102"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl103"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl104"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl105"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl106"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl107"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl108"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl109"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl110"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl111"&lt;/span&gt;, &lt;/p&gt;              &lt;p style="margin: 0px"&gt;        &lt;span style="color: #a31515"&gt;"ctl112"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl113"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl114"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl115"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl116"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl117"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl118"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl119"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl120"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl121"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl122"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl123"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl124"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl125"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl126"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ctl127"&lt;/span&gt;&lt;/p&gt;              &lt;p style="margin: 0px"&gt;     };&lt;/p&gt;           &lt;/div&gt;            &lt;p&gt;As you can see this defines an array containing some predefined IDs to be used when no id is specified for a control; again, this retains uniqueness for control names. At runtime the ID for the control is generated by reading the ‘UniqueID’ property of the Control class.&lt;/p&gt;            &lt;div style="font-family: calibri; background: white; color: black; font-size: 10pt"&gt;             &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;virtual&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; UniqueID&lt;/p&gt;              &lt;p style="margin: 0px"&gt;    {&lt;/p&gt;              &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;get&lt;/span&gt;&lt;/p&gt;              &lt;p style="margin: 0px"&gt;        {&lt;/p&gt;              &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;if&lt;/span&gt; (&lt;span style="color: blue"&gt;this&lt;/span&gt;._cachedUniqueID == &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/p&gt;              &lt;p style="margin: 0px"&gt;            {&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                Control namingContainer = &lt;span style="color: blue"&gt;this&lt;/span&gt;.NamingContainer;&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                &lt;span style="color: blue"&gt;if&lt;/span&gt; (namingContainer == &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                {&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                    &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;this&lt;/span&gt;._id;&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                }&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                &lt;span style="color: blue"&gt;if&lt;/span&gt; (&lt;span style="color: blue"&gt;this&lt;/span&gt;._id == &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                {&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                    &lt;span style="color: blue"&gt;this&lt;/span&gt;.GenerateAutomaticID();&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                }&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                &lt;span style="color: blue"&gt;if&lt;/span&gt; (&lt;span style="color: blue"&gt;this&lt;/span&gt;.Page == namingContainer)&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                {&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                    &lt;span style="color: blue"&gt;this&lt;/span&gt;._cachedUniqueID = &lt;span style="color: blue"&gt;this&lt;/span&gt;._id;&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                }&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                &lt;span style="color: blue"&gt;else&lt;/span&gt;&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                {&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                    &lt;span style="color: blue"&gt;string&lt;/span&gt; uniqueIDPrefix = namingContainer.GetUniqueIDPrefix();&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                    &lt;span style="color: blue"&gt;if&lt;/span&gt; (uniqueIDPrefix.Length == 0)&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                    {&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                        &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;this&lt;/span&gt;._id;&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                    }&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                    &lt;span style="color: blue"&gt;this&lt;/span&gt;._cachedUniqueID = uniqueIDPrefix + &lt;span style="color: blue"&gt;this&lt;/span&gt;._id;&lt;/p&gt;              &lt;p style="margin: 0px"&gt;                }&lt;/p&gt;              &lt;p style="margin: 0px"&gt;            }&lt;/p&gt;              &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;this&lt;/span&gt;._cachedUniqueID;&lt;/p&gt;              &lt;p style="margin: 0px"&gt;        }&lt;/p&gt;              &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;              &lt;p style="margin: 0px"&gt; &lt;/p&gt;              &lt;p&gt;As you can see this code has the following check:&lt;/p&gt;              &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;if&lt;/span&gt; (&lt;span style="color: blue"&gt;this&lt;/span&gt;._id == &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/p&gt;              &lt;p style="margin: 0px"&gt;    {&lt;/p&gt;              &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;this&lt;/span&gt;.GenerateAutomaticID();&lt;/p&gt;              &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;              &lt;p style="margin: 0px"&gt; &lt;/p&gt;              &lt;p&gt;Simply, if there’s no id already in existence for the control at render time then one is generated using a call to the following method:&lt;/p&gt;              &lt;p style="margin: 0px"&gt; &lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; GenerateAutomaticID()&lt;/p&gt;              &lt;div style="font-family: calibri; background: white; color: black; font-size: 10pt"&gt;               &lt;p style="margin: 0px"&gt;{&lt;/p&gt;                &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;this&lt;/span&gt;.flags.Set(0x200000);&lt;/p&gt;                &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;this&lt;/span&gt;._namingContainer.EnsureOccasionalFields();&lt;/p&gt;                &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;int&lt;/span&gt; index = &lt;span style="color: blue"&gt;this&lt;/span&gt;._namingContainer._occasionalFields.NamedControlsID++;&lt;/p&gt;                &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;if&lt;/span&gt; (&lt;span style="color: blue"&gt;this&lt;/span&gt;.EnableLegacyRendering)&lt;/p&gt;                &lt;p style="margin: 0px"&gt;    {&lt;/p&gt;                &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;this&lt;/span&gt;._id = &lt;span style="color: #a31515"&gt;"_ctl"&lt;/span&gt; + index.ToString(NumberFormatInfo.InvariantInfo);&lt;/p&gt;                &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;                &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;else&lt;/span&gt; &lt;span style="color: blue"&gt;if&lt;/span&gt; (index &amp;lt; 0x80)&lt;/p&gt;                &lt;p style="margin: 0px"&gt;    {&lt;/p&gt;                &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;this&lt;/span&gt;._id = automaticIDs[index];&lt;/p&gt;                &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;                &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;else&lt;/span&gt;&lt;/p&gt;                &lt;p style="margin: 0px"&gt;    {&lt;/p&gt;                &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;this&lt;/span&gt;._id = &lt;span style="color: #a31515"&gt;"ctl"&lt;/span&gt; + index.ToString(NumberFormatInfo.InvariantInfo);&lt;/p&gt;                &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;                &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;this&lt;/span&gt;._namingContainer.DirtyNameTable();&lt;/p&gt;                &lt;p style="margin: 0px"&gt;}&lt;/p&gt;             &lt;/div&gt;           &lt;/div&gt;            &lt;p /&gt;            &lt;p /&gt;            &lt;p /&gt;            &lt;ul&gt;             &lt;h3&gt;               &lt;ul /&gt;                &lt;p /&gt;                &lt;p&gt;As you can see, this method simply looks at the specified array of control names for the next ’ctlXXX’ value until it runs out then it generates one. The ctlXXX ‘counter’ restarts for each &lt;strong&gt;NamingContainer&lt;/strong&gt;…so it’s pretty unlikely you’ll get to the end of the static array of control names. The ‘automaticIDs’ array is used simply as a performance optimization…saving even this very simple piece of code from running on each control rendering.&lt;/p&gt;                &lt;p&gt;So What’s With the Control’s ‘Name’ &lt;/p&gt;                &lt;p&gt;In the examples in the previous section you can see that there’s not just an Id attribute, rather there’s also a ‘name’ attribute for each control, e.g., “rootPanel$childPanel1$TextBox". You’ll see that this looks really similar to the Id property (and is in fact generated using almost an identical code-path), so why are there two different attributes. In the simplest explanation, consider the ‘name’ attribute to be the ‘server side’ name and the ‘id’ attribute to be the client side one. &lt;/p&gt;                &lt;p&gt;When you “post’ or ‘get’ a form in HTML the ‘name’ attribute links the specific HTML control to the value which gets posted back; this is where the ‘uniqueness’ part comes in. By being unique it’s possible to hook up the posted value back to the Control on the server, in addition this also specifies the correct event to call on postback. &lt;/p&gt;                &lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; While in current ASP.NET, it’s possible to translate from the name attribute to the id attribute this is not guaranteed  and will most likely break when using the new ASP.NET 4.0 functionality. We will not alter the ‘name’ attribute in ASP.NET 4.0…&lt;/p&gt;                &lt;h3&gt;Client Ids in DataBound Controls&lt;/h3&gt;                &lt;p&gt;The most critical reason for ensuring rendered controls have unique id attributes is controls within Data Bound controls. As an example the following markup defines a simple &lt;strong&gt;ListView&lt;/strong&gt; hooked up to the Northwind database:&lt;/p&gt;                &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                 &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;namingpanel&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="rootPanel"&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;      &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;NamingPanel&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;&lt;/span&gt;         &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;          &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;SqlDataSource&lt;/span&gt; &lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="SqlDataSource2"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;ConnectionString&lt;/span&gt;&lt;span style="color: blue"&gt;="&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;$ ConnectionStrings:ConnectionString &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;              &lt;span style="color: red"&gt;SelectCommand&lt;/span&gt;&lt;span style="color: blue"&gt;="SELECT [ProductName] FROM [Alphabetical list of products]"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;SqlDataSource&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;          &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;ListView&lt;/span&gt; &lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="ListView2"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;DataSourceID&lt;/span&gt;&lt;span style="color: blue"&gt;="SqlDataSource1"&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;              &lt;span style="color: red"&gt;onselectedindexchanged&lt;/span&gt;&lt;span style="color: blue"&gt;="ListView1_SelectedIndexChanged"&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;              &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                  &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt; &lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=""&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                      &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                          &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;Label&lt;/span&gt; &lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="ProductNameLabel"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                              &lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;='&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;# Eval("ProductName") &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;'&lt;/span&gt; &lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                      &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                  &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;              &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                  &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;LayoutTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                  &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;table&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="Table2"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                      &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="Tr4"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                          &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="Td3"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                              &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;table&lt;/span&gt; &lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="itemPlaceholderContainer"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;border&lt;/span&gt;&lt;span style="color: blue"&gt;="0"&lt;/span&gt; &lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=""&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                                  &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="Tr5"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=""&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                                      &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;th&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="Th2"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                                          ProductName&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;th&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                                  &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                                  &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt; &lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="itemPlaceholder"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                                  &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                              &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;table&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                          &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                      &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                      &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="Tr6"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                          &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="Td4"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=""&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                          &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                      &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;                  &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;table&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;              &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;LayoutTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;          &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;ListView&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;      &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;NamingPanel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                  &lt;p style="margin: 0px"&gt;  &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;namingpanel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;               &lt;/div&gt;                &lt;p&gt;The markup above has the &lt;strong&gt;ListView&lt;/strong&gt; inside the &lt;strong&gt;NamingPanels&lt;/strong&gt; we had previously. This markup generates the following HTML (or a snippet of it…)&lt;/p&gt;                &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                 &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;table&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="rootPanel_ctl00_ListView1_itemPlaceholderContainer"&lt;/span&gt; &lt;span style="color: red"&gt;border&lt;/span&gt;&lt;span style="color: blue"&gt;="0"&lt;/span&gt; &lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=""&amp;gt;&lt;/span&gt;&lt;/p&gt;                  &lt;p style="margin: 0px"&gt;       &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt; &lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=""&amp;gt;&lt;/span&gt;&lt;/p&gt;                  &lt;p style="margin: 0px"&gt;          &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;th&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;                  &lt;p style="margin: 0px"&gt;               ProductName&lt;/p&gt;                  &lt;p style="margin: 0px"&gt;          &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;th&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;                  &lt;p style="margin: 0px"&gt;       &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;                  &lt;p style="margin: 0px"&gt;       &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt; &lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=""&amp;gt;&lt;/span&gt;&lt;/p&gt;                  &lt;p style="margin: 0px"&gt;          &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;                  &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;span&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="rootPanel_ctl00_ListView1_ctrl0_ProductNameLabel"&amp;gt;&lt;/span&gt;Chai&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;span&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;                  &lt;p style="margin: 0px"&gt;          &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;                  &lt;p style="margin: 0px"&gt;       &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;                  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;table&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;               &lt;/div&gt;        &lt;p&gt;As you can see, the controls in the ListView are rendered using a mix of user-defined as well as auto-generated ids…this is great for ensuring the names are unique but pretty useless if you need to know the ids of the controls at render time…As an example it’s really difficult to ensure that client side code such as Javascript can easily identify a specific control within the page without mixing in the classic &amp;lt;%=Control.ClientId%&amp;gt; server side markup into the JS.&lt;/p&gt;                &lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Databound controls are more difficult than usual when trying to ensure unique control Ids you only have access to some of the container controls at design-time (e.g., ctrl0 in the above html is not accessible in the designer…so you can’t change the id without hooking into backend events).&lt;/p&gt;                &lt;h3&gt;More Control over Control Ids…ASP.NET 4.0 Client Ids&lt;/h3&gt;                &lt;p&gt;So, what are we doing in ASP.NET 4.0 to let you define the ids? &lt;/p&gt;                &lt;p&gt;&lt;strong&gt;NOTE: The information below is different to the Visual Studio 10 PDC CTP VPC (love those acronyms!). Following the CTP release we refactored to remove the ‘set’ on the ClientId property…this is to improve the behavior of the API, previously the value you got back from ClientId would almost certainly not match the value you set. In the new API you set the Id parameter and can then ‘get’ the ClientId property…&lt;/strong&gt;&lt;/p&gt;                &lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;IMPORTANT: The new Client Id functionality has no impact on the server side name of the control, so string myString = TextBox1.Text; is completely unaffected by the Client Id changing.&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;                &lt;p&gt;In order to enable you to have more control over Client Ids we added a of property on ‘System.Web.UI.Control’:&lt;/p&gt;                &lt;p&gt;&lt;strong&gt;ClientIdMode&lt;/strong&gt;&lt;/p&gt;                &lt;ul&gt;                 &lt;div style="font-family: calibri; background: white; color: black; font-size: 10pt"&gt;                   &lt;ul&gt;                     &lt;li&gt;&lt;strong&gt;Legacy – &lt;/strong&gt;This is exactly equivalent to the ASP.NET 2.0 Client Id behavior. This is also the default if no &lt;em&gt;ClientIdMode&lt;/em&gt; property is set in the current control’s hierarchy. &lt;/li&gt;                      &lt;li&gt;&lt;strong&gt;Static&lt;/strong&gt; – You set it, you get it…most controllable but potentially the least ‘safe’. If a control is set to ‘static’ &lt;em&gt;ClientIdMode&lt;/em&gt; then exactly what you set for Id is used as the client id, no matter what naming container the control sits in. &lt;/li&gt;                      &lt;li&gt;&lt;strong&gt;Predictable&lt;/strong&gt; – Mostly for use in DataBound controls, only uses ‘set’ Id attributes of parent Naming Containers (so, no automatic id generation using ‘ctlXXX’ names). This also works in conjunction with the DataBound control property &lt;em&gt;RowClientIdSuffix&lt;/em&gt; to allow you to define the ‘uniquefying’ item for the specific row. Previously, the auto-generated name ctrl0…ctrl1…ctrl2…etc…was used to provide this uniqueifying function for controls in the rows of DataBound controls. &lt;/li&gt;                      &lt;li&gt;&lt;strong&gt;Inherit&lt;/strong&gt; -  Essentially the ‘default’ behavior for controls, explicitly setting &lt;em&gt;ClientIdMode = ‘Inherit’ &lt;/em&gt;essentially clears the &lt;em&gt;ClientIdMode&lt;/em&gt; for the current control and allows this and any child controls (which have either ‘Inherit’ as &lt;em&gt;ClientIdMode&lt;/em&gt; or &lt;em&gt;ClientIdMode&lt;/em&gt; not set) will take the &lt;em&gt;ClientIdMode&lt;/em&gt; of any parent control (including Page and Config…see below) &lt;/li&gt;                   &lt;/ul&gt;                    &lt;p&gt;&lt;strong&gt;Page&lt;/strong&gt;&lt;/p&gt;                    &lt;p&gt;You can also set the &lt;em&gt;ClientIdMode&lt;/em&gt; at Page level, this defines the default &lt;em&gt;ClientIdMode&lt;/em&gt; for all controls within the current page…&lt;/p&gt;                    &lt;p&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" ClientIdMode="Static"%&amp;gt;&lt;/p&gt;                    &lt;p&gt;&lt;strong&gt;Config&lt;/strong&gt;&lt;/p&gt;                    &lt;p&gt;It’s also possible to set the &lt;em&gt;ClientIdMode&lt;/em&gt; in the config section at either machine or application level…this defines the default &lt;em&gt;ClientIdMode&lt;/em&gt; for all controls within all pages in the application.&lt;/p&gt;                    &lt;p&gt;&amp;lt;system.web&amp;gt;                      &lt;br /&gt;  &amp;lt;pages clientIdMode="Predictable"&amp;gt;&amp;lt;/pages&amp;gt;                       &lt;br /&gt;&amp;lt;/system.web&amp;gt;&lt;/p&gt;                    &lt;p&gt;So what can I do with that?                      &lt;br /&gt;Restarting Control Naming                       &lt;br /&gt;As mentioned earlier the client id for a control is derived from the NamingContainers in which the control sits in the Control Hierarchy, normally this is only the actual controls within the page (e.g., in DataBound controls), however when using MasterPages you can end up with ids as found in the following HTML: &lt;/p&gt;                    &lt;p&gt;    &amp;lt;div id="ctl00_ContentPlaceHolder1_ParentPanel"&amp;gt;                      &lt;br /&gt;        &amp;lt;div id="ctl00_ContentPlaceHolder1_ParentPanel_NamingPanel1"&amp;gt;                       &lt;br /&gt;            &amp;lt;input name="ctl00$ContentPlaceHolder1$ParentPanel$NamingPanel1$TextBox1" type="text" value="Hello!" id="ctl00_ContentPlaceHolder1_ParentPanel_NamingPanel1_TextBox1" /&amp;gt;                       &lt;br /&gt;    &amp;lt;/div&amp;gt; &lt;/p&gt;                    &lt;p&gt;Even though the TextBox shown in the HTML is only within two NamingContainers within the page, due to the way MasterPages hook together you wind up with a control id like the following: ctl00_ContentPlaceHolder1_ParentPanel_NamingPanel1_TextBox1 &lt;/p&gt;                    &lt;p&gt;Obviously this is a pretty long id…guaranteed unique within the page but unnecessarily long for most purposed. In this example we now want to reduce the length of the rendered id and make it more user defined (so, shortened, no ctlXXX etc…). The easiest way to achieve this is the following &lt;/p&gt;                    &lt;p&gt;&amp;lt;tc:NamingPanel runat="server" ID="ParentPanel" ClientIdMode="Static"&amp;gt;                      &lt;br /&gt;    &amp;lt;tc:NamingPanel runat="server" ID="NamingPanel1" ClientIdMode=”Predictable"&amp;gt;                       &lt;br /&gt;        &amp;lt;asp:TextBox ID="TextBox1" runat="server" Text="Hello!"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;                       &lt;br /&gt;    &amp;lt;/tc:NamingPanel&amp;gt;                       &lt;br /&gt;&amp;lt;/tc:NamingPanel&amp;gt; &lt;/p&gt;                    &lt;p&gt;In this sample (identical to earlier markup) we’ve set the ClientIdMode to ‘Static’ on the outermost NamingPanel as well as setting the next ‘Child’ control to ‘Predictable’. This results in this markup (note, the rest of the page, MasterPages etc,…is identical to the previous example) &lt;/p&gt;                    &lt;p&gt;            &amp;lt;div id="ParentPanel"&amp;gt;                      &lt;br /&gt;        &amp;lt;div id="ParentPanel_NamingPanel1"&amp;gt;                       &lt;br /&gt;            &amp;lt;input name="ctl00$ContentPlaceHolder1$ParentPanel$NamingPanel1$TextBox1" type="text" value="Hello!" id="ParentPanel_NamingPanel1_TextBox1" /&amp;gt;                       &lt;br /&gt;    &amp;lt;/div&amp;gt;                       &lt;br /&gt;Here we’ve essentially restarted the naming hierarchy for Controls to the outermost NamingPanel , eliminating the ContentPlaceHolder and MasterPage names from the id (note: the ‘name’ attribute is unaffected…meaning we retain the normal ASP.NET functionality for events, ViewState etc…). A nice side-effect of restarting the naming hierarchy is that even if the markup defining the NamingPanels  is moved to a different ContentPlaceholder, the rendered Client Ids remain the same. &lt;/p&gt;                    &lt;p&gt;NOTE: The developer does now take more responsibility for ensuring that rendered Control Ids are unique…not doing so can break functionality which expect to find unique HTML elements for each Id (e.g., Javascript’s GetElementById()). &lt;/p&gt;                    &lt;p&gt;Predictable DataBound Client Ids                      &lt;br /&gt;As we showed previously, the Client Ids  generated for Controls within DataBound list controls are pretty messy and not really predictable…How does the new Client Id functionality help? &lt;/p&gt;                    &lt;p&gt;We want to achieve the following: &lt;/p&gt;                    &lt;ul&gt;                     &lt;li&gt;Shorten the Client Ids for Controls                        &lt;br /&gt;Make the Client Id predictable                         &lt;br /&gt;Make the Client Id unique across pages (rather than ‘within’ pages)                         &lt;br /&gt;So, how do we do this? &lt;/li&gt;                   &lt;/ul&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;NamingPanel&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="rootPanel"&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;      &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;NamingPanel&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;&lt;/span&gt;         &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;          &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;SqlDataSource&lt;/span&gt; &lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="SqlDataSource1"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;ConnectionString&lt;/span&gt;&lt;span style="color: blue"&gt;="&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;$ ConnectionStrings:ConnectionString &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;              &lt;span style="color: red"&gt;SelectCommand&lt;/span&gt;&lt;span style="color: blue"&gt;="SELECT [ProductName], [ProductID] FROM [Alphabetical list of products]"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;SqlDataSource&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;          &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;ListView&lt;/span&gt; &lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="ListView1"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;DataSourceID&lt;/span&gt;&lt;span style="color: blue"&gt;="SqlDataSource1"&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;              &lt;span style="color: red"&gt;onselectedindexchanged&lt;/span&gt;&lt;span style="color: blue"&gt;="ListView1_SelectedIndexChanged"&lt;/span&gt; &lt;span style="color: red"&gt;ClientIdMode&lt;/span&gt;&lt;span style="color: blue"&gt;=”Predictable”&lt;/span&gt; &lt;span style="color: red"&gt;ClientIdRowSuffix&lt;/span&gt;&lt;span style="color: blue"&gt;=”ProductID”&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;              &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                  &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt; &lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=""&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                      &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                          &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;Label&lt;/span&gt; &lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="ProductNameLabel"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                              &lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;='&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;# Eval("ProductName") &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;'&lt;/span&gt; &lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                      &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                  &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;              &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                  &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;LayoutTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                  &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;table&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="Table1"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                      &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="Tr1"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                          &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="Td1"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                              &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;table&lt;/span&gt; &lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="itemPlaceholderContainer"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;border&lt;/span&gt;&lt;span style="color: blue"&gt;="0"&lt;/span&gt; &lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=""&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                                  &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="Tr2"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=""&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                                      &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;th&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="Th1"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                                          ProductName&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;th&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                                  &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                                  &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt; &lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;="itemPlaceholder"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                                  &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                              &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;table&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                          &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                      &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                      &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="Tr3"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                          &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="Td2"&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;="server"&lt;/span&gt; &lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=""&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                          &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                      &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;                  &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;table&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;              &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;LayoutTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;          &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;ListView&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;      &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;NamingPanel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;  &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;tc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;NamingPanel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/p&gt;                    &lt;p&gt;In the markup above, we have used the &lt;strong&gt;ClientIdMode&lt;/strong&gt; and &lt;strong&gt;ClientIdRowSuffix&lt;/strong&gt; properties. &lt;strong&gt;ClientIdRowSuffix&lt;/strong&gt; is a property which can only be used in &lt;strong&gt;DataBound&lt;/strong&gt; controls and actually differs based on the &lt;strong&gt;DataBound&lt;/strong&gt; control it’s used with: &lt;/p&gt;                    &lt;p&gt;GridView: You can specify the name of a column in the &lt;strong&gt;DataSource&lt;/strong&gt; or multiple columns which are then combined at runtime. As an example if you specified &lt;strong&gt;ClientIdRowSuffix&lt;/strong&gt; as “ProductName, ProductId” in a &lt;strong&gt;GridView&lt;/strong&gt;  then the rendered control Id would be "rootPanel_GridView1_ProductNameLabel_Chai_1”. &lt;/p&gt;                    &lt;p&gt;ListView: You can specify a single column in the &lt;strong&gt;DataSource&lt;/strong&gt; which will be appended to the Client Id. As an example if you specified &lt;strong&gt;ClientIdRowSuffix&lt;/strong&gt; as “ProductName” in a ListViewthen the rendered control Id would be "rootPanel_ListView1_ProductNameLabel_1”. In this case the last ‘1’ comes from the ProductId of the DataItem. &lt;/p&gt;                    &lt;p&gt;&lt;strong&gt;Repeater&lt;/strong&gt;: No &lt;strong&gt;ClientIdRowSuffix&lt;/strong&gt; property is allowed. In a Repeater the index of the Row is used. In the case above, you would wind up with "rootPanel_Repeater1_ProductNameLabel_0”. The ‘0’ is simply the index of the current row. &lt;/p&gt;                    &lt;p&gt;Note: &lt;strong&gt;FormView&lt;/strong&gt;, &lt;strong&gt;DetailsView&lt;/strong&gt; do not have multiple rows so do not have a &lt;strong&gt;ClientIdRowSuffix&lt;/strong&gt; property. &lt;/p&gt;                    &lt;h3&gt;Conclusion &lt;/h3&gt;                    &lt;p&gt;So, there you have it…I dare say I’ll post again in future about this topic, we have a sample app which will find it’s way onto &lt;a href="http://www.codeplex.com/aspnet"&gt;Codeplex&lt;/a&gt; in the near future! &lt;/p&gt;                    &lt;p&gt;Matthew Osborn from our QA team has also posted on this stuff…&lt;/p&gt;                    &lt;p&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; In current CTP builds you cannot use &lt;em&gt;UpdatePanel&lt;/em&gt;s with controls when you use the new Client Id functionality. This is fixed internally and will work correctly in future public releases.&lt;/font&gt;&lt;/p&gt;                    &lt;p /&gt;                 &lt;/div&gt;               &lt;/ul&gt;             &lt;/h3&gt;           &lt;/ul&gt;                   &lt;p /&gt;       &lt;/font&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://mostlylucid.net/aggbug/1303.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Galloway</dc:creator>
            <guid>http://mostlylucid.net/archive/2008/11/03/way-too-much-information-on-control-ids-and-asp.net-4.0.aspx</guid>
            <pubDate>Mon, 03 Nov 2008 21:41:30 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2008/11/03/way-too-much-information-on-control-ids-and-asp.net-4.0.aspx#feedback</comments>
            <slash:comments>8</slash:comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/1303.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>
