<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" 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:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>All things .NET and beyond - ASP.NET</title>
    <link>http://www.fluxtah.com/</link>
    <description>Ian (Fluxtah) Warwick's blog</description>
    <language>en-us</language>
    <copyright>Ian Warwick</copyright>
    <lastBuildDate>Sun, 08 Mar 2009 15:59:00 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>fluxtah@hotmail.com</managingEditor>
    <webMaster>fluxtah@hotmail.com</webMaster>
    <item>
      <trackback:ping>http://www.fluxtah.com/Trackback.aspx?guid=3d65da05-9fe1-40bd-b8c7-c20ab6cbd60e</trackback:ping>
      <pingback:server>http://www.fluxtah.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.fluxtah.com/PermaLink,guid,3d65da05-9fe1-40bd-b8c7-c20ab6cbd60e.aspx</pingback:target>
      <dc:creator>Fluxtah</dc:creator>
      <wfw:comment>http://www.fluxtah.com/CommentView,guid,3d65da05-9fe1-40bd-b8c7-c20ab6cbd60e.aspx</wfw:comment>
      <wfw:commentRss>http://www.fluxtah.com/SyndicationService.asmx/GetEntryCommentsRss?guid=3d65da05-9fe1-40bd-b8c7-c20ab6cbd60e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
A cool thing, did not realise this, you can use a @MasterType directive in an ASP.NET
page to strongly type the Master property, quite cool. 
</p>
        <pre>&lt;%@ MasterType TypeName="BaseMaster" %&gt;</pre>
        <img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=3d65da05-9fe1-40bd-b8c7-c20ab6cbd60e" />
      </body>
      <title>ASP.NET MasterType Directive</title>
      <guid isPermaLink="false">http://www.fluxtah.com/PermaLink,guid,3d65da05-9fe1-40bd-b8c7-c20ab6cbd60e.aspx</guid>
      <link>http://www.fluxtah.com/2009/03/08/ASPNETMasterTypeDirective.aspx</link>
      <pubDate>Sun, 08 Mar 2009 15:59:00 GMT</pubDate>
      <description>&lt;p&gt;
A&amp;nbsp;cool thing, did not realise this, you can use a @MasterType directive in an&amp;nbsp;ASP.NET
page to strongly type the Master property, quite cool. 
&lt;/p&gt;
&lt;pre&gt;&amp;lt;%@ MasterType TypeName="BaseMaster" %&amp;gt;&lt;/pre&gt;&lt;img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=3d65da05-9fe1-40bd-b8c7-c20ab6cbd60e" /&gt;</description>
      <comments>http://www.fluxtah.com/CommentView,guid,3d65da05-9fe1-40bd-b8c7-c20ab6cbd60e.aspx</comments>
      <category>General</category>
      <category>ASP.NET</category>
    </item>
    <item>
      <trackback:ping>http://www.fluxtah.com/Trackback.aspx?guid=1afa48d5-32fd-499b-b44e-09dd9e90e12c</trackback:ping>
      <pingback:server>http://www.fluxtah.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.fluxtah.com/PermaLink,guid,1afa48d5-32fd-499b-b44e-09dd9e90e12c.aspx</pingback:target>
      <dc:creator>Fluxtah</dc:creator>
      <wfw:comment>http://www.fluxtah.com/CommentView,guid,1afa48d5-32fd-499b-b44e-09dd9e90e12c.aspx</wfw:comment>
      <wfw:commentRss>http://www.fluxtah.com/SyndicationService.asmx/GetEntryCommentsRss?guid=1afa48d5-32fd-499b-b44e-09dd9e90e12c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
This is cool, if you write your own http module by implementing IHttpModule you can
subscribe to any events that it raises in the Global.asax, just like you would with
Application_Start, Application_End, etc you can do the same with your own events with
the signature ModuleName_EventName. 
</p>
        <p>
So if you had a IHttpModule, say, StatsModule with an event, Start, you can subscribe
to the start event with StatsModule_Start. 
</p>
        <p>
Its described on this <a title="ASP.NET Application Life Cycle Overview for IIS 5.0 and 6.0" href="http://msdn.microsoft.com/en-gb/library/ms178473.aspx" target="_blank">MSDN
Docs page for ASP.NET Application Life Cycle Overview for IIS 5.0 and 6.0</a>. 
</p>
        <p>
Very cool! 
</p>
        <img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=1afa48d5-32fd-499b-b44e-09dd9e90e12c" />
      </body>
      <title>Handling IHttpModule Events in Global.asax</title>
      <guid isPermaLink="false">http://www.fluxtah.com/PermaLink,guid,1afa48d5-32fd-499b-b44e-09dd9e90e12c.aspx</guid>
      <link>http://www.fluxtah.com/2009/03/08/HandlingIHttpModuleEventsInGlobalasax.aspx</link>
      <pubDate>Sun, 08 Mar 2009 01:00:00 GMT</pubDate>
      <description>&lt;p&gt;
This is cool, if you write your own http module by implementing IHttpModule you can
subscribe to any events that it raises in the Global.asax, just like you would with
Application_Start, Application_End, etc you can do the same with your own events with
the signature ModuleName_EventName. 
&lt;/p&gt;
&lt;p&gt;
So if you had a IHttpModule, say, StatsModule with an event, Start, you can subscribe
to the start event with StatsModule_Start. 
&lt;/p&gt;
&lt;p&gt;
Its described on this &lt;a title="ASP.NET Application Life Cycle Overview for IIS 5.0 and 6.0" href="http://msdn.microsoft.com/en-gb/library/ms178473.aspx" target=_blank&gt;MSDN
Docs page for ASP.NET Application Life Cycle Overview for IIS 5.0 and 6.0&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
Very cool! 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=1afa48d5-32fd-499b-b44e-09dd9e90e12c" /&gt;</description>
      <comments>http://www.fluxtah.com/CommentView,guid,1afa48d5-32fd-499b-b44e-09dd9e90e12c.aspx</comments>
      <category>ASP.NET</category>
    </item>
    <item>
      <trackback:ping>http://www.fluxtah.com/Trackback.aspx?guid=42cc208c-ae7f-4546-84ac-f489cb5d4667</trackback:ping>
      <pingback:server>http://www.fluxtah.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.fluxtah.com/PermaLink,guid,42cc208c-ae7f-4546-84ac-f489cb5d4667.aspx</pingback:target>
      <dc:creator>Fluxtah</dc:creator>
      <wfw:commentRss>http://www.fluxtah.com/SyndicationService.asmx/GetEntryCommentsRss?guid=42cc208c-ae7f-4546-84ac-f489cb5d4667</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
It can be quite handy to use the ~ with <strong>ResolveUrl</strong> or for url properties
of server controls, however, it does not work for ordinary markup, for instance: 
</p>
        <pre>&lt;a href="~/Foo/Bar.aspx"&gt;&lt;/a&gt;</pre>
        <p>
would not work since you have to add the runat="server". You can work around this
with the following if you happen to have access to Page:
</p>
        <pre>&lt;a href="&lt;%=ResolveUrl("~/Foo/Bar.aspx") %&gt;"&gt;&lt;/a&gt;</pre>
        <p>
But what if you do not have access to Page? Well, there is the option of rolling your
own ResolveUrl, which is the approach I have taken many times. 
</p>
        <p>
I am still on a mission brushing up on my ASP.NET and found a community comment on
the <a title="ASP.NET Web Site Paths" href="http://msdn.microsoft.com/en-gb/library/ms178116.aspx" target="_blank">MSDN
Docs for ASP.NET Web Site Paths</a> that has a out-of-the-box way of doing this as
follows: 
</p>
        <pre>&lt;a href="&lt;%=System.Web.VirtualPathUtility.ToAbsolute("~/Foo/Bar.aspx")%&gt;"&gt;&lt;/a&gt;</pre>
        <p>
 Very handy! and its been in since .NET 2.0 so it shows how much I am missing
out on by not thumbing through the ASP.NET docs. 
</p>
        <img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=42cc208c-ae7f-4546-84ac-f489cb5d4667" />
      </body>
      <title>ASP.NET Tilde (~) Prefixed URLs, resolving for client controls</title>
      <guid isPermaLink="false">http://www.fluxtah.com/PermaLink,guid,42cc208c-ae7f-4546-84ac-f489cb5d4667.aspx</guid>
      <link>http://www.fluxtah.com/2009/03/07/ASPNETTildePrefixedURLsResolvingForClientControls.aspx</link>
      <pubDate>Sat, 07 Mar 2009 03:31:00 GMT</pubDate>
      <description>&lt;p&gt;
It can be quite handy to use the ~ with &lt;strong&gt;ResolveUrl&lt;/strong&gt; or for url properties
of server controls, however, it does not work for ordinary markup, for instance:&amp;nbsp;
&lt;/p&gt;
&lt;pre&gt;&amp;lt;a href="~/Foo/Bar.aspx"&amp;gt;&amp;lt;/a&amp;gt;&lt;/pre&gt;
&lt;p&gt;
would not work since you have to add the runat="server". You can work around this
with the following if you happen to have access to Page:
&lt;/p&gt;
&lt;pre&gt;&amp;lt;a href="&amp;lt;%=ResolveUrl("~/Foo/Bar.aspx") %&amp;gt;"&amp;gt;&amp;lt;/a&amp;gt;&lt;/pre&gt;
&lt;p&gt;
But what if you do not have access to Page? Well, there is the option of rolling your
own ResolveUrl, which is the approach I have taken many times. 
&lt;/p&gt;
&lt;p&gt;
I am still on a mission brushing up on my ASP.NET and found a community comment on
the &lt;a title="ASP.NET Web Site Paths" href="http://msdn.microsoft.com/en-gb/library/ms178116.aspx" target=_blank&gt;MSDN
Docs for ASP.NET Web Site Paths&lt;/a&gt; that has a out-of-the-box way of doing this as
follows: 
&lt;/p&gt;
&lt;pre&gt;&amp;lt;a href="&amp;lt;%=System.Web.VirtualPathUtility.ToAbsolute("~/Foo/Bar.aspx")%&amp;gt;"&amp;gt;&amp;lt;/a&amp;gt;&lt;/pre&gt;
&lt;p&gt;
&amp;nbsp;Very handy! and its been in since .NET 2.0 so it shows how much I am missing
out on by not thumbing through the ASP.NET docs. 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=42cc208c-ae7f-4546-84ac-f489cb5d4667" /&gt;</description>
      <comments>http://www.fluxtah.com/CommentView,guid,42cc208c-ae7f-4546-84ac-f489cb5d4667.aspx</comments>
      <category>ASP.NET</category>
    </item>
    <item>
      <trackback:ping>http://www.fluxtah.com/Trackback.aspx?guid=f4749396-7aa5-4aac-b14a-eb2cc3ca02b0</trackback:ping>
      <pingback:server>http://www.fluxtah.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.fluxtah.com/PermaLink,guid,f4749396-7aa5-4aac-b14a-eb2cc3ca02b0.aspx</pingback:target>
      <dc:creator>Fluxtah</dc:creator>
      <wfw:commentRss>http://www.fluxtah.com/SyndicationService.asmx/GetEntryCommentsRss?guid=f4749396-7aa5-4aac-b14a-eb2cc3ca02b0</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
According to the <a title="ASP.NET and XHTML" href="http://msdn.microsoft.com/en-gb/library/exc57y7e.aspx" target="_blank">ASP.NET
Docs on XHTML Conformance</a> if you try to validate an ASP.NET page with the W3C
XHTML validation service it might not report it as valid XHTML simply because the
W3C validation service does not report itself as a browser that ASP.NET recognises. 
</p>
        <p>
You can get around this problem by creating a browser definition in a .browser file
that you put into your App_Browsers folder of your ASP.NET website.<br /><br />
Yoinked directly from the docs: 
</p>
        <pre>&lt;browsers&gt;<br />
  &lt;browser id="W3C_Validator" parentID="default"&gt;<br />
    &lt;identification&gt;<br />
        &lt;userAgent match="^W3C_Validator" /&gt;<br />
    &lt;/identification&gt;<br />
    &lt;capabilities&gt;<br />
      &lt;capability name="browser"             
value="W3C Validator" /&gt;<br />
      &lt;capability name="ecmaScriptVersion"   
value="1.2" /&gt;<br />
      &lt;capability name="javascript"          
value="true" /&gt;<br />
      &lt;capability name="supportsCss"         
value="true" /&gt;<br />
      &lt;capability name="tables"              
value="true" /&gt;<br />
      &lt;capability name="tagWriter" 
<br />
         value="System.Web.UI.HtmlTextWriter"
/&gt;<br />
      &lt;capability name="w3cdomversion"       
value="1.0" /&gt;<br />
    &lt;/capabilities&gt;<br />
  &lt;/browser&gt;<br />
&lt;/browsers&gt;</pre>
        <p>
This might just be handy to know at some point, although most good browser based web
dev tool suites offer the ability to validate XHTML, and I believe they send the content
to validate from rendered markup in your browser. 
</p>
        <img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=f4749396-7aa5-4aac-b14a-eb2cc3ca02b0" />
      </body>
      <title>Validating ASP.NET Pages with W3C Validation Service</title>
      <guid isPermaLink="false">http://www.fluxtah.com/PermaLink,guid,f4749396-7aa5-4aac-b14a-eb2cc3ca02b0.aspx</guid>
      <link>http://www.fluxtah.com/2009/03/06/ValidatingASPNETPagesWithW3CValidationService.aspx</link>
      <pubDate>Fri, 06 Mar 2009 06:21:00 GMT</pubDate>
      <description>&lt;p&gt;
According to the &lt;a title="ASP.NET and XHTML" href="http://msdn.microsoft.com/en-gb/library/exc57y7e.aspx" target=_blank&gt;ASP.NET
Docs on XHTML Conformance&lt;/a&gt; if you try to validate an ASP.NET page with the W3C
XHTML validation service it might not report it as valid XHTML simply because the
W3C validation service does not report itself as a browser that ASP.NET recognises. 
&lt;/p&gt;
&lt;p&gt;
You can get around this problem by creating a browser definition in a .browser file
that you put into your App_Browsers folder of your ASP.NET website.&lt;br&gt;
&lt;br&gt;
Yoinked directly from the docs: 
&lt;/p&gt;
&lt;pre&gt;&amp;lt;browsers&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;browser id="W3C_Validator" parentID="default"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;identification&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;userAgent match="^W3C_Validator" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/identification&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;capabilities&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;capability name="browser"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
value="W3C Validator" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;capability name="ecmaScriptVersion"&amp;nbsp;&amp;nbsp;&amp;nbsp;
value="1.2" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;capability name="javascript"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
value="true" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;capability name="supportsCss"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
value="true" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;capability name="tables"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
value="true" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;capability name="tagWriter" 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value="System.Web.UI.HtmlTextWriter"
/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;capability name="w3cdomversion"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
value="1.0" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/capabilities&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/browser&amp;gt;&lt;br&gt;
&amp;lt;/browsers&amp;gt;&lt;/pre&gt;
&lt;p&gt;
This might just be handy to know at some point, although most good browser based web
dev tool suites offer the ability to validate XHTML, and I believe they send the content
to validate from rendered markup in your browser. 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=f4749396-7aa5-4aac-b14a-eb2cc3ca02b0" /&gt;</description>
      <comments>http://www.fluxtah.com/CommentView,guid,f4749396-7aa5-4aac-b14a-eb2cc3ca02b0.aspx</comments>
      <category>ASP.NET</category>
    </item>
    <item>
      <trackback:ping>http://www.fluxtah.com/Trackback.aspx?guid=e50fe877-ca05-41aa-bde0-df27934ba623</trackback:ping>
      <pingback:server>http://www.fluxtah.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.fluxtah.com/PermaLink,guid,e50fe877-ca05-41aa-bde0-df27934ba623.aspx</pingback:target>
      <dc:creator>Fluxtah</dc:creator>
      <wfw:commentRss>http://www.fluxtah.com/SyndicationService.asmx/GetEntryCommentsRss?guid=e50fe877-ca05-41aa-bde0-df27934ba623</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Yesterday, I thumbed through the C# Docs looking for stuff I might not know yet, and
today I am doing the same thing for ASP.NET in hope to fill in some gaps that might
help me with a technical interview I have coming up on tuesday.<br /><br />
This is something I did not know, in the web.config you can add a tag to define what
level of XHTML compliance to render. 
</p>
        <pre>&lt;system.web&gt;<br />
&lt;!-- other elements here --&gt;<br />
    &lt;xhtmlConformance 
<br />
        mode="Legacy" /&gt;<br />
&lt;/system.web&gt;</pre>
        <p>
Where <strong>mode</strong> could be one of 3 values (<a title="How to: Configure XHTML Rendering in ASP.NET Web Sites" href="http://msdn.microsoft.com/en-gb/library/ms178159.aspx" target="_blank">taken
directly from the MSDN How to page for XHTML Conformance</a>):<br /><br />
Legacy (which is similar to how markup was rendered in previous versions of ASP.NET) 
</p>
        <p>
Transitional (XHTML 1.0 Transitional) 
</p>
        <p>
Strict (XHTML 1.0 Strict) 
</p>
        <img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=e50fe877-ca05-41aa-bde0-df27934ba623" />
      </body>
      <title>XHTML Conformance in ASP.NET</title>
      <guid isPermaLink="false">http://www.fluxtah.com/PermaLink,guid,e50fe877-ca05-41aa-bde0-df27934ba623.aspx</guid>
      <link>http://www.fluxtah.com/2009/03/06/XHTMLConformanceInASPNET.aspx</link>
      <pubDate>Fri, 06 Mar 2009 06:03:00 GMT</pubDate>
      <description>&lt;p&gt;
Yesterday, I thumbed through the C# Docs looking for stuff I might not know yet, and
today I am doing the same thing for ASP.NET in hope to fill in some gaps that might
help me with a technical interview I have coming up on tuesday.&lt;br&gt;
&lt;br&gt;
This is something I did not know, in the web.config you can add a tag to define what
level of XHTML compliance to render. 
&lt;/p&gt;
&lt;pre&gt;&amp;lt;system.web&amp;gt;&lt;br&gt;
&amp;lt;!-- other elements here --&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xhtmlConformance 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mode="Legacy" /&amp;gt;&lt;br&gt;
&amp;lt;/system.web&amp;gt;&lt;/pre&gt;
&lt;p&gt;
Where &lt;strong&gt;mode&lt;/strong&gt; could be one of 3 values (&lt;a title="How to: Configure XHTML Rendering in ASP.NET Web Sites" href="http://msdn.microsoft.com/en-gb/library/ms178159.aspx" target=_blank&gt;taken
directly from the MSDN How to page for XHTML Conformance&lt;/a&gt;):&lt;br&gt;
&lt;br&gt;
Legacy (which is similar to how markup was rendered in previous versions of ASP.NET) 
&lt;/p&gt;
&lt;p&gt;
Transitional (XHTML 1.0 Transitional) 
&lt;/p&gt;
&lt;p&gt;
Strict (XHTML 1.0 Strict) 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=e50fe877-ca05-41aa-bde0-df27934ba623" /&gt;</description>
      <comments>http://www.fluxtah.com/CommentView,guid,e50fe877-ca05-41aa-bde0-df27934ba623.aspx</comments>
      <category>ASP.NET</category>
    </item>
    <item>
      <trackback:ping>http://www.fluxtah.com/Trackback.aspx?guid=bf96ff69-00a6-4ad4-84c4-3eb2ab23469e</trackback:ping>
      <pingback:server>http://www.fluxtah.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.fluxtah.com/PermaLink,guid,bf96ff69-00a6-4ad4-84c4-3eb2ab23469e.aspx</pingback:target>
      <dc:creator>Fluxtah</dc:creator>
      <wfw:commentRss>http://www.fluxtah.com/SyndicationService.asmx/GetEntryCommentsRss?guid=bf96ff69-00a6-4ad4-84c4-3eb2ab23469e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
At work I was implementing a search form that required a 3 tier drop down, so I thought
the CascadingDropDown would be perfect for this. 
</p>
        <p>
It turns out that the CascadingDropDown was not quite right for the requirements,
the last drop down in the 3 tiers had to be enabled and items had to be selectable
but also had to filter the other 2 upper tiers. 
</p>
        <p>
After some thought, the only way to achieve this was having the ability to programatically
add my own values to be passed to the knownCategoryValues argument of the web service
method for a CascadingDropDown behavior. 
</p>
        <p>
To do this, I had to redefine a method on the CascadingDropDown behavior, I could
then invoke this method to force the ajax callback for any CascadingDropDown of my
choice. Here is that method. 
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">AjaxControlToolkit.CascadingDropDownBehavior.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">prototype</span>._onParentChange2 <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span>(evt,
inInit, moreKnownCatValues) { <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">///
&lt;summary&gt;</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">///
Handler for the parent drop down's change event</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">///
&lt;/summary&gt;</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">///
&lt;param name="evt" type="Object"&gt;</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">///
Set by the browser when called as an event handler (unused here)</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">///
&lt;/param&gt;</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">///
&lt;param name="inInit" type="Boolean"&gt;</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">///
Whether this is being called from the initialize method</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">///
&lt;/param&gt;</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">///
&lt;returns /&gt;</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">var</span> e <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span>.get_element(); <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">//
Create the known category/value pairs string for sending to the helper web service</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">//
Follow parent pointers so that the complete state can be sent</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">//
Format: 'name1:value1;name2:value2;...'</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">var</span> knownCategoryValues <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> ''; <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">var</span> parentControlID <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span>._parentControlID; <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">while</span> (parentControlID)
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">var</span> parentElement <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> $get(parentControlID); <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">if</span> (parentElement
&amp;&amp; (-1 !<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> parentElement.selectedIndex))
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">var</span> selectedValue <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> parentElement.options[parentElement.selectedIndex].value; <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">if</span> (selectedValue
&amp;&amp; selectedValue !<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">""</span>)
{ knownCategoryValues <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> parentElement.CascadingDropDownCategory <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">+</span> ':' <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">+</span> selectedValue <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">+</span> ';' <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">+</span> knownCategoryValues;
parentControlID <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> parentElement.CascadingDropDownParentControlID; <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">continue</span>;
} } <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">break</span>;
} <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">if</span> (knownCategoryValues
!<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> ''
&amp;&amp; <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span>._lastParentValues
== knownCategoryValues) { <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span>;
} <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span>._lastParentValues <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> knownCategoryValues; <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">//
we have a parent but it doesn't have a valid value</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">//</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">if</span> (knownCategoryValues
== '' &amp;&amp; <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span>._parentControlID)
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span>._setOptions(null,
inInit); <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span>;
} <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">//
Show the loading text (if any)</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span>._setOptions(null,
inInit, true); <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">if</span> (<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span>._servicePath
&amp;&amp; <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span>._serviceMethod)
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">//
Raise the populating event and optionally cancel the web service invocation</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">var</span> eventArgs <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> new
Sys.CancelEventArgs(); <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span>.raisePopulating(eventArgs); <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">if</span> (eventArgs.get_cancel())
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span>;
} <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">if</span> (moreKnownCatValues)
{ knownCategoryValues += <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">";"</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">+</span> moreKnownCatValues;
} <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">//
Create the service parameters and optionally add the context parameter</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">//
(thereby determining which method signature we're expecting...)</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">var</span> params <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> {
knownCategoryValues: knownCategoryValues, category: <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span>._category
}; <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">if</span> (<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span>._useContextKey)
{ params.contextKey <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span>._contextKey;
} <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">//
Call the helper web service</span> Sys.Net.WebServiceProxy.invoke(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span>._servicePath, <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span>._serviceMethod,
false, params, <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">Function</span>.createDelegate(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span>, <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span>._onMethodComplete), <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">Function</span>.createDelegate(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span>, <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">this</span>._onMethodError));
$common.updateFormToRefreshATDeviceBuffer(); } }</span>
        </pre>
        <p>
The method above is just a copy of _onParentChange method of the CascadingDropDown
behavior, I called it _onParentChange2 and call this one when I want to invoke an
ajax callback, the only difference is the extra argument moreKnownCatValues, the value
of this argument will be appended to the knownCategoryValues which will get passed
to the callback method. The changes to the original method have been bolded. 
</p>
        <p>
Now its possible to invoke a callback on any CascadingDropDown with the code below. 
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">$find('CDD1')._onParentChange2(null,
false, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"CountryId:25"</span>);</span>
        </pre>
        <p>
The line above will get a reference to a CascadingDropDown behaviour that I have given
a BehaviorID of CDD1, it will then invoke the new _onParentChange2 method passing
through my extra value of CountryId:25. 
</p>
        <p>
Its a shame that the CascadingDropDown does not have a more elegant approach for adding
to the knownCategoryValues programatically, but at least this workaround is not to
hacky.  
</p>
        <p>
 
</p>
        <img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=bf96ff69-00a6-4ad4-84c4-3eb2ab23469e" />
      </body>
      <title>Passing through extra values with the CascadingDropDown</title>
      <guid isPermaLink="false">http://www.fluxtah.com/PermaLink,guid,bf96ff69-00a6-4ad4-84c4-3eb2ab23469e.aspx</guid>
      <link>http://www.fluxtah.com/2008/11/06/PassingThroughExtraValuesWithTheCascadingDropDown.aspx</link>
      <pubDate>Thu, 06 Nov 2008 01:52:00 GMT</pubDate>
      <description>&lt;p&gt;
At work I was implementing a search form that required a 3 tier drop down, so I thought
the CascadingDropDown would be perfect for this. 
&lt;/p&gt;
&lt;p&gt;
It turns out that the CascadingDropDown was not quite right for the requirements,
the last drop down in the 3 tiers had to be enabled and items had to be selectable
but also had to filter the other 2 upper tiers. 
&lt;/p&gt;
&lt;p&gt;
After some thought, the only way to achieve this was having the ability to programatically
add my own values to be passed to the knownCategoryValues argument of the web service
method for a CascadingDropDown behavior. 
&lt;/p&gt;
&lt;p&gt;
To do this, I had to redefine a method on the CascadingDropDown behavior, I could
then invoke this method to force the ajax callback for any CascadingDropDown of my
choice. Here is that method. 
&lt;/p&gt;
&lt;pre&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px"&gt;AjaxControlToolkit.CascadingDropDownBehavior.&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;prototype&lt;/span&gt;._onParentChange2 &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;function&lt;/span&gt;(evt,
inInit, moreKnownCatValues) { &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;///
&amp;lt;summary&amp;gt;&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;///
Handler for the parent drop down's change event&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;///
&amp;lt;/summary&amp;gt;&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;///
&amp;lt;param name="evt" type="Object"&amp;gt;&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;///
Set by the browser when called as an event handler (unused here)&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;///
&amp;lt;/param&amp;gt;&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;///
&amp;lt;param name="inInit" type="Boolean"&amp;gt;&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;///
Whether this is being called from the initialize method&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;///
&amp;lt;/param&amp;gt;&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;///
&amp;lt;returns /&amp;gt;&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;var&lt;/span&gt; e &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt;.get_element(); &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;//
Create the known category/value pairs string for sending to the helper web service&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;//
Follow parent pointers so that the complete state can be sent&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;//
Format: 'name1:value1;name2:value2;...'&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;var&lt;/span&gt; knownCategoryValues &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; ''; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;var&lt;/span&gt; parentControlID &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt;._parentControlID; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;while&lt;/span&gt; (parentControlID)
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;var&lt;/span&gt; parentElement &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; $get(parentControlID); &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;if&lt;/span&gt; (parentElement
&amp;amp;&amp;amp; (-1 !&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; parentElement.selectedIndex))
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;var&lt;/span&gt; selectedValue &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; parentElement.options[parentElement.selectedIndex].value; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;if&lt;/span&gt; (selectedValue
&amp;amp;&amp;amp; selectedValue !&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;""&lt;/span&gt;)
{ knownCategoryValues &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; parentElement.CascadingDropDownCategory &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;+&lt;/span&gt; ':' &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;+&lt;/span&gt; selectedValue &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;+&lt;/span&gt; ';' &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;+&lt;/span&gt; knownCategoryValues;
parentControlID &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; parentElement.CascadingDropDownParentControlID; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;continue&lt;/span&gt;;
} } &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;break&lt;/span&gt;;
} &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;if&lt;/span&gt; (knownCategoryValues
!&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; ''
&amp;amp;&amp;amp; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt;._lastParentValues
== knownCategoryValues) { &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt;;
} &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt;._lastParentValues &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; knownCategoryValues; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;//
we have a parent but it doesn't have a valid value&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;//&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;if&lt;/span&gt; (knownCategoryValues
== '' &amp;amp;&amp;amp; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt;._parentControlID)
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt;._setOptions(null,
inInit); &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt;;
} &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;//
Show the loading text (if any)&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt;._setOptions(null,
inInit, true); &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;if&lt;/span&gt; (&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt;._servicePath
&amp;amp;&amp;amp; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt;._serviceMethod)
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;//
Raise the populating event and optionally cancel the web service invocation&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;var&lt;/span&gt; eventArgs &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; new
Sys.CancelEventArgs(); &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt;.raisePopulating(eventArgs); &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;if&lt;/span&gt; (eventArgs.get_cancel())
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt;;
} &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;if&lt;/span&gt; (moreKnownCatValues)
{ knownCategoryValues += &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;";"&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;+&lt;/span&gt; moreKnownCatValues;
} &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;//
Create the service parameters and optionally add the context parameter&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;//
(thereby determining which method signature we're expecting...)&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;var&lt;/span&gt; params &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; {
knownCategoryValues: knownCategoryValues, category: &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt;._category
}; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;if&lt;/span&gt; (&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt;._useContextKey)
{ params.contextKey &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt;._contextKey;
} &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;//
Call the helper web service&lt;/span&gt; Sys.Net.WebServiceProxy.invoke(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt;._servicePath, &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt;._serviceMethod,
false, params, &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;Function&lt;/span&gt;.createDelegate(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt;, &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt;._onMethodComplete), &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;Function&lt;/span&gt;.createDelegate(&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt;, &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;this&lt;/span&gt;._onMethodError));
$common.updateFormToRefreshATDeviceBuffer(); } }&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
The method above is just a copy of _onParentChange method of the CascadingDropDown
behavior, I called it _onParentChange2 and call this one when I want to invoke an
ajax callback, the only difference is the extra argument moreKnownCatValues, the value
of this argument will be appended to the knownCategoryValues which will get passed
to the callback method. The changes to the original method have been bolded. 
&lt;/p&gt;
&lt;p&gt;
Now its possible to invoke a callback on any CascadingDropDown with the code below.&amp;nbsp;
&lt;/p&gt;
&lt;pre&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px"&gt;$find('CDD1')._onParentChange2(null,
false, &lt;span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px"&gt;"CountryId:25"&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
The line above will get a reference to a CascadingDropDown behaviour that I have given
a BehaviorID of CDD1, it will then invoke the new _onParentChange2 method passing
through my extra value of CountryId:25. 
&lt;/p&gt;
&lt;p&gt;
Its a shame that the CascadingDropDown does not have a more elegant approach for adding
to the knownCategoryValues programatically, but at least this workaround is not to
hacky.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=bf96ff69-00a6-4ad4-84c4-3eb2ab23469e" /&gt;</description>
      <comments>http://www.fluxtah.com/CommentView,guid,bf96ff69-00a6-4ad4-84c4-3eb2ab23469e.aspx</comments>
      <category>ASP.NET</category>
    </item>
    <item>
      <trackback:ping>http://www.fluxtah.com/Trackback.aspx?guid=0f1cd736-fdf3-416e-a848-297a2922a26d</trackback:ping>
      <pingback:server>http://www.fluxtah.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.fluxtah.com/PermaLink,guid,0f1cd736-fdf3-416e-a848-297a2922a26d.aspx</pingback:target>
      <dc:creator>Fluxtah</dc:creator>
      <wfw:commentRss>http://www.fluxtah.com/SyndicationService.asmx/GetEntryCommentsRss?guid=0f1cd736-fdf3-416e-a848-297a2922a26d</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I've created a new <a title="Ajax Snippets at the codeplex project site" href="http://www.codeplex.com/ajaxsnippets">Ajax
Snippets</a> demo video, like my last one, its very rough but I hope I communicate
the general idea of the project effectively. 
</p>
        <p>
The video covers the new SnippetCallback wizard and best guess parameter mapping.  
</p>
        <p>
          <a title="Watch the demonstration video" href="/SnippetDemo/SnippetDemo.html">Watch
the demonstration video</a>
        </p>
        <p>
          <a title="Download the source code from the video" href="/SnippetDemo/SnippetSample.zip">Download
the source code from the video</a>
        </p>
        <img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=0f1cd736-fdf3-416e-a848-297a2922a26d" />
      </body>
      <title>New Ajax Snippets demonstration video</title>
      <guid isPermaLink="false">http://www.fluxtah.com/PermaLink,guid,0f1cd736-fdf3-416e-a848-297a2922a26d.aspx</guid>
      <link>http://www.fluxtah.com/2008/10/08/NewAjaxSnippetsDemonstrationVideo.aspx</link>
      <pubDate>Wed, 08 Oct 2008 15:34:00 GMT</pubDate>
      <description>&lt;p&gt;
I've created a new &lt;a title="Ajax Snippets at the codeplex project site" href="http://www.codeplex.com/ajaxsnippets"&gt;Ajax
Snippets&lt;/a&gt; demo video, like my last one, its very rough but I hope I communicate
the general idea of the project effectively. 
&lt;/p&gt;
&lt;p&gt;
The video covers the new SnippetCallback wizard and best guess parameter mapping.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
&lt;a title="Watch the demonstration video" href="/SnippetDemo/SnippetDemo.html"&gt;Watch
the demonstration video&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;a title="Download the source code from the video" href="/SnippetDemo/SnippetSample.zip"&gt;Download
the source code from the video&lt;/a&gt; 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=0f1cd736-fdf3-416e-a848-297a2922a26d" /&gt;</description>
      <comments>http://www.fluxtah.com/CommentView,guid,0f1cd736-fdf3-416e-a848-297a2922a26d.aspx</comments>
      <category>ASP.NET</category>
    </item>
    <item>
      <trackback:ping>http://www.fluxtah.com/Trackback.aspx?guid=e557c615-bcb7-4020-a9b7-1bcbe57fd927</trackback:ping>
      <pingback:server>http://www.fluxtah.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.fluxtah.com/PermaLink,guid,e557c615-bcb7-4020-a9b7-1bcbe57fd927.aspx</pingback:target>
      <dc:creator>Fluxtah</dc:creator>
      <wfw:commentRss>http://www.fluxtah.com/SyndicationService.asmx/GetEntryCommentsRss?guid=e557c615-bcb7-4020-a9b7-1bcbe57fd927</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I just released my latest updates to the <a title="Ajax Snippets" href="http://www.codeplex.com/ajaxsnippets">Ajax
Snippets</a> project, the following notes summarise whats new.<br /></p>
        <p>
          <strong>ADDED </strong>
        </p>
        <ul>
          <li>
SnippetCallback now has an action list item, 'Javascript function stubs to clipboard' 
</li>
          <li>
SnippetCallback now has a designer action list option to configure the callback through
a wizard 
</li>
          <li>
Ability to override default value extractors and add new ones 
</li>
          <li>
The Map parameters wizard step of the SnippetCallback wizard now best guesses the
mappings by matching the name of the parameter to a control id 
</li>
          <li>
Snippets can now be used as ordinary web user controls where they can be dropped straight
on a page with the advantage of SnippetCallbacks 
<br /></li>
        </ul>
        <p>
          <strong>FIXED </strong>
        </p>
        <ul>
          <li>
Javascript function stubs to clipboard feature was creating incorrect javascript 
</li>
          <li>
SnippetCallback wizard was not saving WebServiceVirtualPath property 
</li>
          <li>
Snippets now throw the correct exception if errors occur whilst retrieving them from
a web service 
</li>
          <li>
SnippetManager was not managing css references correctly 
<br /></li>
        </ul>
        <img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=e557c615-bcb7-4020-a9b7-1bcbe57fd927" />
      </body>
      <title>Ajax Snippets 0.4a released</title>
      <guid isPermaLink="false">http://www.fluxtah.com/PermaLink,guid,e557c615-bcb7-4020-a9b7-1bcbe57fd927.aspx</guid>
      <link>http://www.fluxtah.com/2008/10/08/AjaxSnippets04aReleased.aspx</link>
      <pubDate>Wed, 08 Oct 2008 13:29:00 GMT</pubDate>
      <description>&lt;p&gt;
I just released my latest updates to the &lt;a title="Ajax Snippets" href="http://www.codeplex.com/ajaxsnippets"&gt;Ajax
Snippets&lt;/a&gt; project, the following notes summarise whats new.&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;ADDED &lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
SnippetCallback now has an action list item, 'Javascript function stubs to clipboard' 
&lt;li&gt;
SnippetCallback now has a designer action list option to configure the callback through
a wizard 
&lt;li&gt;
Ability to override default value extractors and add new ones 
&lt;li&gt;
The Map parameters wizard step of the SnippetCallback wizard now best guesses the
mappings by matching the name of the parameter to a control id 
&lt;li&gt;
Snippets can now be used as ordinary web user controls where they can be dropped straight
on a page with the advantage of SnippetCallbacks 
&lt;br&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;FIXED &lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Javascript function stubs to clipboard feature was creating incorrect javascript 
&lt;li&gt;
SnippetCallback wizard was not saving WebServiceVirtualPath property 
&lt;li&gt;
Snippets now throw the correct exception if errors occur whilst retrieving them from
a web service 
&lt;li&gt;
SnippetManager was not managing css references correctly 
&lt;br&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=e557c615-bcb7-4020-a9b7-1bcbe57fd927" /&gt;</description>
      <comments>http://www.fluxtah.com/CommentView,guid,e557c615-bcb7-4020-a9b7-1bcbe57fd927.aspx</comments>
      <category>ASP.NET</category>
    </item>
    <item>
      <trackback:ping>http://www.fluxtah.com/Trackback.aspx?guid=6ce89986-3062-4db4-bde1-4368947df37c</trackback:ping>
      <pingback:server>http://www.fluxtah.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.fluxtah.com/PermaLink,guid,6ce89986-3062-4db4-bde1-4368947df37c.aspx</pingback:target>
      <dc:creator>Fluxtah</dc:creator>
      <wfw:commentRss>http://www.fluxtah.com/SyndicationService.asmx/GetEntryCommentsRss?guid=6ce89986-3062-4db4-bde1-4368947df37c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I almost wrote off the idea that this was even remotely possible until I looked into
it more <a title="on msdn" href="http://msdn.microsoft.com/en-us/library/bb385682.aspx#Features">on
msdn</a> and found an example. 
</p>
        <pre>/// &lt;reference name "Ajax.js" assembly="System.Web.Extensions, ..." /&gt; 
<br /><br />
After doctoring it for my own script and assembly it was not working after trying
several different renditions and wondering if it would ever work with the missing
= in the name attribute and what the hell the ... was, I finally came to something
that worked. </pre>
        <pre>/// &lt;reference name="AjaxSnippets.SnippetManager.js" assembly="AjaxSnippets" /&gt;</pre>
        <p>
SnippetManager.js is the file in my AjaxSnippets.dll. 
</p>
        <p>
The only snag is that I have not been able to get it to work in a script block inside
an aspx page, but it does work in a js file.  
</p>
        <img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=6ce89986-3062-4db4-bde1-4368947df37c" />
      </body>
      <title>ASP.NET Ajax javascript intellisense for scripts in referenced assemblies</title>
      <guid isPermaLink="false">http://www.fluxtah.com/PermaLink,guid,6ce89986-3062-4db4-bde1-4368947df37c.aspx</guid>
      <link>http://www.fluxtah.com/2008/10/06/ASPNETAjaxJavascriptIntellisenseForScriptsInReferencedAssemblies.aspx</link>
      <pubDate>Mon, 06 Oct 2008 17:47:00 GMT</pubDate>
      <description>&lt;p&gt;
I almost wrote off the idea that this was even remotely possible until I looked into
it more &lt;a title="on msdn" href="http://msdn.microsoft.com/en-us/library/bb385682.aspx#Features"&gt;on
msdn&lt;/a&gt; and found an example. 
&lt;/p&gt;
&lt;pre&gt;/// &amp;lt;reference name "Ajax.js" assembly="System.Web.Extensions, ..." /&amp;gt; 
&lt;br&gt;
&lt;br&gt;
After doctoring it for my own script and assembly it was not working after trying
several different renditions and wondering if it would ever work with the missing
= in the name attribute and what the hell the ... was, I finally came to something
that worked. &lt;/pre&gt;&lt;pre&gt;/// &amp;lt;reference name="AjaxSnippets.SnippetManager.js" assembly="AjaxSnippets" /&amp;gt;&lt;/pre&gt;
&lt;p&gt;
SnippetManager.js is the file in my AjaxSnippets.dll. 
&lt;/p&gt;
&lt;p&gt;
The only snag is that I have not been able to get it to work in a script block inside
an aspx page, but it does work in a js file.&amp;nbsp; 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=6ce89986-3062-4db4-bde1-4368947df37c" /&gt;</description>
      <comments>http://www.fluxtah.com/CommentView,guid,6ce89986-3062-4db4-bde1-4368947df37c.aspx</comments>
      <category>ASP.NET</category>
    </item>
    <item>
      <trackback:ping>http://www.fluxtah.com/Trackback.aspx?guid=96799bdf-58d2-4274-8b80-7a21ce1d66a6</trackback:ping>
      <pingback:server>http://www.fluxtah.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.fluxtah.com/PermaLink,guid,96799bdf-58d2-4274-8b80-7a21ce1d66a6.aspx</pingback:target>
      <dc:creator>Fluxtah</dc:creator>
      <wfw:commentRss>http://www.fluxtah.com/SyndicationService.asmx/GetEntryCommentsRss?guid=96799bdf-58d2-4274-8b80-7a21ce1d66a6</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In an SnippetCallback, when defining mapping between a web service method parameter
and a control, there is a client-side function for each control type that deals
with extracting the value from the control and passing it as the web service methods
parameter. 
</p>
        <p>
By default most of the simple web controls (TextBox, Checkbox, RadioButtonList,
etc) that come out-of-the-box with ASP.NET already have a corresponding client-side
value extractor function defined, but obviously this is not good enough if you want
to use custom controls. 
</p>
        <p>
To override these or add new ones there are two things that need to be done, first
off a new extractor function would have to be defined in configuration. 
</p>
        <pre>&lt;configSections&gt;<br />
  &lt;section name="ajaxSnippets" type="AjaxSnippets.Configuration.AjaxSnippetsConfigurationSection,
AjaxSnippets"/&gt;<br />
&lt;/configSections&gt;<br />
&lt;ajaxSnippets&gt;<br />
  &lt;extractors&gt;<br />
    &lt;add controlType="System.Web.UI.WebControls.TextBox" functionName="myCustomTextBoxExtractor"
/&gt;<br />
    &lt;add controlType="My.Custom.Control" functionName="fromMyCustomControl"
/&gt;<br />
  &lt;/extractors&gt;<br />
&lt;/ajaxSnippets&gt;</pre>
        <p>
In this example, I am overriding the textbox extractor with my own function myCustomTextBoxExtractor,
secondly I am defining a new value extractor fromMyCustomControl for My.Custom.Control. 
</p>
        <p>
Now the next thing that needs to be done is to write the client functions, this can
be done by creating a new javascript file, which would need to be included in the
page that Ajax Snippets are being used. 
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">AjaxSnippets.ValueExtractors.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">prototype</span>.myCustomTextBoxExtractor <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span>(id){ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">var</span> el <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> $get(id); <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">//
Extract value from el and return it here </span> } AjaxSnippets.ValueExtractors.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">prototype</span>.fromMyCustomControl <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span>(id){ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">var</span> el <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> $get(id); <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">//
Extract value from el and return it here </span> } </span>
        </pre>
        <p>
Ajax Snippets has a ValueExtractors class, and its simply just a job of adding functions
to its prototype. 
</p>
        <p>
To give a better example, the ValueExtractors default prototype is below
in full, in its current state from Ajax Snippets 0.3a release. 
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">AjaxSnippets.ValueExtractors.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">prototype</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> {
fromAny: <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span>(id)
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span> id;
}, fromTextBox: <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span>(id)
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span> $get(id).value;
}, fromDropDown: <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span>(id)
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">var</span> el <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> $get(id); <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span> el.options[el.selectedIndex].value;
}, fromRadioList: <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span>(id)
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">var</span> i,
els <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> $get(id).getElementsByTagName('<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">input</span>'); <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">for</span> (i <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> 0;
i &lt; els.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">length</span>;
i++) { <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">if</span> (els[i].<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">checked</span>)
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span> els[i].value;
} } <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span> null;
}, fromCheckList: <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span>(id)
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">var</span> i,
els <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> $get(id).getElementsByTagName('<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">input</span>'),
vals <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> new <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">Array</span>(); <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">for</span> (i <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> 0;
i &lt; els.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">length</span>;
i++) { vals.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">push</span>(els[i].<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">checked</span>);
} <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span> vals;
}, fromListBox: <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span>(id)
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">var</span> i,
el <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> $get(id),
vals <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> new <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">Array</span>(); <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">for</span> (i <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> 0;
i &lt; el.options.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">length</span>;
i++) { <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">if</span> (el.options[i].selected)
{ vals.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">push</span>(el.options[i].value);
} } <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span> vals;
}, fromCheckBox: <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">function</span>(id)
{ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">return</span> $get(id).<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">checked</span>;
} };</span>
        </pre>
        <img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=96799bdf-58d2-4274-8b80-7a21ce1d66a6" />
      </body>
      <title>Overriding client value extractors in Ajax Snippets, and adding new ones</title>
      <guid isPermaLink="false">http://www.fluxtah.com/PermaLink,guid,96799bdf-58d2-4274-8b80-7a21ce1d66a6.aspx</guid>
      <link>http://www.fluxtah.com/2008/10/05/OverridingClientValueExtractorsInAjaxSnippetsAndAddingNewOnes.aspx</link>
      <pubDate>Sun, 05 Oct 2008 16:19:00 GMT</pubDate>
      <description>&lt;p&gt;
In an SnippetCallback, when defining mapping between a web service method&amp;nbsp;parameter
and a&amp;nbsp;control, there is a client-side function for each control type that deals
with extracting the value from the control and passing it as the web service methods
parameter. 
&lt;/p&gt;
&lt;p&gt;
By default most of the simple&amp;nbsp;web controls (TextBox, Checkbox,&amp;nbsp;RadioButtonList,
etc)&amp;nbsp;that come out-of-the-box with ASP.NET already have a corresponding client-side
value extractor function defined, but obviously this is not good enough if you want
to use custom controls. 
&lt;/p&gt;
&lt;p&gt;
To override these or add new ones there are two things that need to be done, first
off a new extractor function would have to be defined in configuration. 
&lt;/p&gt;
&lt;pre&gt;&amp;lt;configSections&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;section name="ajaxSnippets" type="AjaxSnippets.Configuration.AjaxSnippetsConfigurationSection,
AjaxSnippets"/&amp;gt;&lt;br&gt;
&amp;lt;/configSections&amp;gt;&lt;br&gt;
&amp;lt;ajaxSnippets&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;extractors&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add controlType="System.Web.UI.WebControls.TextBox" functionName="myCustomTextBoxExtractor"
/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add controlType="My.Custom.Control" functionName="fromMyCustomControl"
/&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/extractors&amp;gt;&lt;br&gt;
&amp;lt;/ajaxSnippets&amp;gt;&lt;/pre&gt;
&lt;p&gt;
In this example, I am overriding the textbox extractor with my own function myCustomTextBoxExtractor,
secondly I am defining a new value extractor fromMyCustomControl for My.Custom.Control. 
&lt;/p&gt;
&lt;p&gt;
Now the next thing that needs to be done is to write the client functions, this can
be done by creating a new javascript file, which would need to be included in the
page that Ajax Snippets are being used. 
&lt;/p&gt;
&lt;pre&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px"&gt;AjaxSnippets.ValueExtractors.&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;prototype&lt;/span&gt;.myCustomTextBoxExtractor &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;function&lt;/span&gt;(id){ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;var&lt;/span&gt; el &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; $get(id); &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;//
Extract value from el and return it here &lt;/span&gt; } AjaxSnippets.ValueExtractors.&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;prototype&lt;/span&gt;.fromMyCustomControl &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;function&lt;/span&gt;(id){ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;var&lt;/span&gt; el &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; $get(id); &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px"&gt;//
Extract value from el and return it here &lt;/span&gt; } &lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
Ajax Snippets has a ValueExtractors class, and its simply just a job of adding functions
to its prototype. 
&lt;/p&gt;
&lt;p&gt;
To give a better example, the ValueExtractors&amp;nbsp;default prototype&amp;nbsp;is below
in full, in its current state from Ajax Snippets 0.3a release. 
&lt;/p&gt;
&lt;pre&gt;&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px"&gt;AjaxSnippets.ValueExtractors.&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;prototype&lt;/span&gt; &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; {
fromAny: &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;function&lt;/span&gt;(id)
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt; id;
}, fromTextBox: &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;function&lt;/span&gt;(id)
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt; $get(id).value;
}, fromDropDown: &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;function&lt;/span&gt;(id)
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;var&lt;/span&gt; el &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; $get(id); &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt; el.options[el.selectedIndex].value;
}, fromRadioList: &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;function&lt;/span&gt;(id)
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;var&lt;/span&gt; i,
els &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; $get(id).getElementsByTagName('&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;input&lt;/span&gt;'); &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;for&lt;/span&gt; (i &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; 0;
i &amp;lt; els.&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;length&lt;/span&gt;;
i++) { &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;if&lt;/span&gt; (els[i].&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;checked&lt;/span&gt;)
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt; els[i].value;
} } &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt; null;
}, fromCheckList: &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;function&lt;/span&gt;(id)
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;var&lt;/span&gt; i,
els &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; $get(id).getElementsByTagName('&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;input&lt;/span&gt;'),
vals &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; new &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;Array&lt;/span&gt;(); &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;for&lt;/span&gt; (i &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; 0;
i &amp;lt; els.&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;length&lt;/span&gt;;
i++) { vals.&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;push&lt;/span&gt;(els[i].&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;checked&lt;/span&gt;);
} &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt; vals;
}, fromListBox: &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;function&lt;/span&gt;(id)
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;var&lt;/span&gt; i,
el &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; $get(id),
vals &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; new &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;Array&lt;/span&gt;(); &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;for&lt;/span&gt; (i &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;=&lt;/span&gt; 0;
i &amp;lt; el.options.&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px"&gt;length&lt;/span&gt;;
i++) { &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;if&lt;/span&gt; (el.options[i].selected)
{ vals.&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;push&lt;/span&gt;(el.options[i].value);
} } &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt; vals;
}, fromCheckBox: &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;function&lt;/span&gt;(id)
{ &lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;return&lt;/span&gt; $get(id).&lt;span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px"&gt;checked&lt;/span&gt;;
} };&lt;/span&gt;&lt;/pre&gt;&lt;img width="0" height="0" src="http://www.fluxtah.com/aggbug.ashx?id=96799bdf-58d2-4274-8b80-7a21ce1d66a6" /&gt;</description>
      <comments>http://www.fluxtah.com/CommentView,guid,96799bdf-58d2-4274-8b80-7a21ce1d66a6.aspx</comments>
      <category>ASP.NET</category>
      <category>General</category>
    </item>
  </channel>
</rss>