<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET AJAX UI</title><link>http://forums.asp.net/1008.aspx</link><description>Here you can discuss UI-related issues with AJAX such as controls and client-side functionality including Silverlight controls for ASP.NET</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: HOWTO: Write controls compatible with UpdatePanel without linking to the ASP.NET AJAX DLL</title><link>http://forums.asp.net/thread/1974721.aspx</link><pubDate>Thu, 25 Oct 2007 20:46:39 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1974721</guid><dc:creator>stock</dc:creator><author>stock</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1974721.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1974721</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal"&gt;My ASP.NET Ajax page has a LinkButton under the UpdatePanel. When clicking the
link button, another web page test.aspx will pop up in a new window. &lt;span&gt;&amp;nbsp;&lt;/span&gt;I used &lt;font size="3"&gt;&lt;font face="Times New Roman"&gt;Eilon&amp;#39;s&lt;/font&gt;&lt;/font&gt; ScriptManagerHelper class to register
the javascript aiming to open a new window. Here is the event handler when
clicking on the link button:&lt;/p&gt;

&lt;p class="MsoNormal"&gt;protected void lbutton_Click(object sender, EventArgs e)&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;System.Text.StringBuilder strBuilder = new System.Text.StringBuilder();&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span&gt;&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;&amp;nbsp;
&lt;/span&gt;strBuilder.Append(&amp;quot;&amp;lt;script language=&amp;#39;javascript&amp;#39;&amp;gt;&amp;quot;);&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span&gt;&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;&amp;nbsp;
&lt;/span&gt;strBuilder.Append(&amp;quot;x=0; y=0; if(screen){x=(screen.availWidth -
900)/2; y = (screen.availHeight - 700)/2;}&amp;quot;);&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span&gt;&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;&amp;nbsp;
&lt;/span&gt;strBuilder.Append(&amp;quot;window.open(&amp;#39;&amp;quot; + &amp;quot;../forms/test.aspx&amp;quot;
+ &amp;quot;&amp;#39;, &amp;#39;CustomPopUp&amp;#39;, &amp;quot;);&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span&gt;&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;&amp;nbsp;
&lt;/span&gt;strBuilder.Append(&amp;quot;&amp;#39;width=900, height=600,
left=&amp;#39;+x+&amp;#39;,top=&amp;#39;+y+&amp;#39;,screenX=&amp;#39;+x+&amp;#39;,screenY=&amp;#39;+y+&amp;#39;,menubar=yes, scrollbars=yes,
status=yes, resizable=yes&amp;#39;)&amp;quot;);&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span&gt;&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;&amp;nbsp; &lt;/span&gt;strBuilder.Append(&amp;quot;&amp;lt;/script&amp;gt;&amp;quot;);&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;ScriptManagerHelper.RegisterStartupScript(this, this.GetType(),
&amp;quot;PopupScript&amp;quot;, strBuilder.ToString(), true);&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;}&lt;/p&gt;

&lt;p class="MsoNormal"&gt;The new window cannot be opened. If just using “window.open();”,
it cannot be opened either. Both of them have this error: There is no source
code available for the current location. Any comments about this error? Thanks.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal"&gt;PC&lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: HOWTO: Write controls compatible with UpdatePanel without linking to the ASP.NET AJAX DLL</title><link>http://forums.asp.net/thread/1637235.aspx</link><pubDate>Mon, 26 Mar 2007 14:15:03 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1637235</guid><dc:creator>LSU.Net</dc:creator><author>LSU.Net</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1637235.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1637235</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Alhambraeidos,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Hay dos funcciones que tienen el mismo nombre. Necesita usted usar ese sintactico:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;        Type scriptManagerType = Type.GetType(&lt;span class="st"&gt;"System.Web.UI.ScriptManager, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&lt;/span&gt;, &lt;span class="kwd"&gt;false&lt;/span&gt;);
        &lt;span class="kwd"&gt;if&lt;/span&gt; (scriptManagerType != &lt;span class="kwd"&gt;null&lt;/span&gt;)
        {
            &lt;span class="cmt"&gt;//ScriptManager.RegisterClientScriptResource(Control, Type, string);&lt;/span&gt;

            RegisterClientScriptResourceMethod = scriptManagerType.GetMethod(&lt;span class="st"&gt;"RegisterClientScriptResource"&lt;/span&gt;, 
                &lt;span class="kwd"&gt;new&lt;/span&gt; Type[] { &lt;span class="kwd"&gt;typeof&lt;/span&gt;(Control), &lt;span class="kwd"&gt;typeof&lt;/span&gt;(Type), &lt;span class="kwd"&gt;typeof&lt;/span&gt;(System.String)});
        }&lt;/pre&gt;&amp;nbsp;&amp;nbsp;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: HOWTO: Write controls compatible with UpdatePanel without linking to the ASP.NET AJAX DLL</title><link>http://forums.asp.net/thread/1637084.aspx</link><pubDate>Mon, 26 Mar 2007 12:51:37 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1637084</guid><dc:creator>alhambraeidos</dc:creator><author>alhambraeidos</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1637084.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1637084</wfw:commentRss><description>&lt;p&gt;Hello mister,&lt;/p&gt;
&lt;p&gt;I'll try your code source in ASP.NET AJAX Release not Beta, &amp;nbsp;and it fails in this line:&lt;/p&gt;
&lt;p&gt;RegisterClientScriptResourceMethod = scriptManagerType.GetMethod(&lt;span class=st&gt;&lt;font color=#ff0000&gt;"RegisterClientScriptResource"&lt;/font&gt;&lt;/span&gt;);&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;The error is : Ambigous match found.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Any solution about this issue ?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks, mister, regards&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&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;&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; &lt;/p&gt;</description></item><item><title>Re: HOWTO: Write controls compatible with UpdatePanel without linking to the ASP.NET AJAX DLL</title><link>http://forums.asp.net/thread/1561807.aspx</link><pubDate>Fri, 02 Feb 2007 22:32:04 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1561807</guid><dc:creator>Pluginbaby</dc:creator><author>Pluginbaby</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1561807.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1561807</wfw:commentRss><description>&lt;p&gt;Unfortunatly that still do not work for me.&lt;/p&gt;
&lt;p&gt;I'm using ASP.NET AJAX RTM.&lt;/p&gt;
&lt;p&gt;Is there a new way to detect if AJAX is enable ?&lt;/p&gt;</description></item><item><title>Re: HOWTO: Write controls compatible with UpdatePanel without linking to the ASP.NET AJAX DLL</title><link>http://forums.asp.net/thread/1557310.aspx</link><pubDate>Wed, 31 Jan 2007 14:24:39 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1557310</guid><dc:creator>kilik</dc:creator><author>kilik</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1557310.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1557310</wfw:commentRss><description>&lt;p&gt;Made a slight mistake in the solution.&amp;nbsp; The Type array argument&amp;nbsp; for the GetMethod() call for RegisterStartupScript and RegisterClientScriptBlock will need an array that looks like this:&lt;/p&gt;&lt;p&gt;&amp;nbsp;parms = new Type[] { typeof(Control), typeof(Type), typeof(string), typeof(string), typeof(bool)};&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: HOWTO: Write controls compatible with UpdatePanel without linking to the ASP.NET AJAX DLL</title><link>http://forums.asp.net/thread/1557264.aspx</link><pubDate>Wed, 31 Jan 2007 13:58:03 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1557264</guid><dc:creator>kilik</dc:creator><author>kilik</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1557264.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1557264</wfw:commentRss><description>FYI - there seems to be an issue with the ScriptManagerHelper running
against the release version of ASP.NET AJAX.&amp;nbsp; There are now overloaded
versions of RegisterClientScriptResource, RegisterStartupScript, and
RegisterStartupScript so you'll need to qualify your calls to
Type.GetMethod().&amp;nbsp; You'll get an 'Ambigous match found' exception if
you run the code as is.&lt;br /&gt;
&lt;br /&gt;
To resolve the issue simply set up a Type array...&lt;br /&gt;
&lt;br /&gt;
Type[] parms = new Type[]{typeof(Control), typeof(Type), typeof(string)};&lt;br /&gt;
&lt;br /&gt;
...and then pass that as the second argument to each of the&amp;nbsp; GetMethod() calls.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
Hope this helps.</description></item><item><title>Re: HOWTO: Write controls compatible with UpdatePanel without linking to the ASP.NET AJAX DLL</title><link>http://forums.asp.net/thread/1557262.aspx</link><pubDate>Wed, 31 Jan 2007 13:57:12 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1557262</guid><dc:creator>kilik</dc:creator><author>kilik</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1557262.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1557262</wfw:commentRss><description>FYI - there seems to be an issue with the ScriptManagerHelper running
against the release version of ASP.NET AJAX.&amp;nbsp; There are now overloaded
versions of RegisterClientScriptResource, RegisterStartupScript, and
RegisterStartupScript so you'll need to qualify your calls to
Type.GetMethod().&amp;nbsp; You'll get an 'Ambigous match found' exception if
you run the code as is.&lt;br /&gt;
&lt;br /&gt;
To resolve the issue simply set up a Type array...&lt;br /&gt;
&lt;br /&gt;
Type[] parms = new Type[]{typeof(Control), typeof(Type), typeof(string)};&lt;br /&gt;
&lt;br /&gt;
...and then pass that as the second argument to each of the&amp;nbsp; GetMethod() calls.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
Hope this helps.</description></item><item><title>ScriptManagerHelper translated to VB.Net</title><link>http://forums.asp.net/thread/1536532.aspx</link><pubDate>Wed, 17 Jan 2007 17:46:25 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1536532</guid><dc:creator>LurkingVariable</dc:creator><author>LurkingVariable</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1536532.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1536532</wfw:commentRss><description>&lt;p&gt;Hey All, thanks Eilon, good stuff.&amp;nbsp;Here is my first-draft VB.Net Translation of Eilon's &lt;font size=2&gt;ScriptManagerHelper, including the "filling in" of&amp;nbsp;some areas he probably omitted for brevity (like &lt;font size=2&gt;IsMicrosoftAjaxAvailable and &lt;font size=2&gt;RegisterStartupScript):&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;pre class=coloredcode&gt;&lt;span class=kwd&gt;Friend Class&lt;/span&gt; ScriptManagerHelper
    &lt;span class=cmt&gt;'from: http://forums.asp.net/thread/1445844.aspx, posted by Eilon, http://weblogs.asp.net/LeftSlipper/ 
&lt;/span&gt;    &lt;span class=kwd&gt;Private Shared ReadOnly&lt;/span&gt; ReflectionLock &lt;span class=kwd&gt;As Object&lt;/span&gt; = &lt;span class=kwd&gt;New Object&lt;/span&gt;()
    &lt;span class=kwd&gt;Private Shared&lt;/span&gt; MethodsInitialized &lt;span class=kwd&gt;As Boolean
    Private Shared&lt;/span&gt; RegisterClientScriptResourceMethod &lt;span class=kwd&gt;As&lt;/span&gt; System.Reflection.MethodInfo
    &lt;span class=kwd&gt;Private Shared&lt;/span&gt; RegisterStartupScriptMethod &lt;span class=kwd&gt;As&lt;/span&gt; System.Reflection.MethodInfo
    &lt;span class=kwd&gt;Private Shared&lt;/span&gt; mbIsMicrosoftAjaxAvailable &lt;span class=kwd&gt;As Boolean&lt;/span&gt; = &lt;span class=kwd&gt;False
    Private Shared Sub&lt;/span&gt; InitializeHelper()
        &lt;span class=kwd&gt;If Not&lt;/span&gt; MethodsInitialized &lt;span class=kwd&gt;Then
            SyncLock&lt;/span&gt; (ReflectionLock)
                &lt;span class=kwd&gt;If Not&lt;/span&gt; MethodsInitialized &lt;span class=kwd&gt;Then&lt;/span&gt;
                    &lt;span class=cmt&gt;'Eilon says we should use this...
                    'Dim scriptManagerType As Type = Type.GetType("Microsoft.Web.UI.ScriptManager, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", False)
                    'but I found this worked for me...
&lt;/span&gt;                    &lt;span class=kwd&gt;Dim&lt;/span&gt; scriptManagerType &lt;span class=kwd&gt;As&lt;/span&gt; Type = Type.&lt;span class=kwd&gt;GetType&lt;/span&gt;(&lt;span class=st&gt;"System.Web.UI.ScriptManager, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&lt;/span&gt;, &lt;span class=kwd&gt;False&lt;/span&gt;)
                    &lt;span class=kwd&gt;If Not&lt;/span&gt; scriptManagerType &lt;span class=kwd&gt;Is Nothing Then&lt;/span&gt;
                        mbIsMicrosoftAjaxAvailable = &lt;span class=kwd&gt;True&lt;/span&gt;
                        RegisterClientScriptResourceMethod = scriptManagerType.GetMethod(&lt;span class=st&gt;"RegisterClientScriptResource"&lt;/span&gt;)
                        RegisterStartupScriptMethod = scriptManagerType.GetMethod(&lt;span class=st&gt;"RegisterStartupScript"&lt;/span&gt;)
                    &lt;span class=kwd&gt;End If&lt;/span&gt;
                    MethodsInitialized = &lt;span class=kwd&gt;True
                End If
            End SyncLock
        End If
    End Sub
    Public Shared Sub&lt;/span&gt; RegisterClientScriptResource(&lt;span class=kwd&gt;ByVal&lt;/span&gt; control &lt;span class=kwd&gt;As&lt;/span&gt; Control, &lt;span class=kwd&gt;ByVal&lt;/span&gt; type &lt;span class=kwd&gt;As&lt;/span&gt; Type, &lt;span class=kwd&gt;ByVal&lt;/span&gt; resourceName &lt;span class=kwd&gt;As String&lt;/span&gt;)
        InitializeHelper()
        &lt;span class=kwd&gt;If Not&lt;/span&gt; RegisterClientScriptResourceMethod &lt;span class=kwd&gt;Is Nothing Then&lt;/span&gt;
            RegisterClientScriptResourceMethod.Invoke(&lt;span class=kwd&gt;Nothing&lt;/span&gt;, &lt;span class=kwd&gt;New Object&lt;/span&gt;() {control, type, resourceName})
        &lt;span class=kwd&gt;Else&lt;/span&gt;
            control.Page.ClientScript.RegisterClientScriptResource(type, resourceName)
        &lt;span class=kwd&gt;End If
    End Sub
    Public Shared Sub&lt;/span&gt; RegisterStartupScript(&lt;span class=kwd&gt;ByVal&lt;/span&gt; control &lt;span class=kwd&gt;As&lt;/span&gt; Control, &lt;span class=kwd&gt;ByVal&lt;/span&gt; type &lt;span class=kwd&gt;As&lt;/span&gt; Type, &lt;span class=kwd&gt;ByVal&lt;/span&gt; key &lt;span class=kwd&gt;As String&lt;/span&gt;, &lt;span class=kwd&gt;ByVal&lt;/span&gt; script &lt;span class=kwd&gt;As String&lt;/span&gt;, &lt;span class=kwd&gt;ByVal&lt;/span&gt; addScriptTags &lt;span class=kwd&gt;As Boolean&lt;/span&gt;)
        InitializeHelper()
        &lt;span class=kwd&gt;If Not&lt;/span&gt; RegisterStartupScriptMethod &lt;span class=kwd&gt;Is Nothing Then&lt;/span&gt;
            RegisterStartupScriptMethod.Invoke(&lt;span class=kwd&gt;Nothing&lt;/span&gt;, &lt;span class=kwd&gt;New Object&lt;/span&gt;() {control, type, key, script, addScriptTags})
        &lt;span class=kwd&gt;Else&lt;/span&gt;
            control.Page.ClientScript.RegisterStartupScript(type, key, script, addScriptTags)
        &lt;span class=kwd&gt;End If
    End Sub
    Public Shared ReadOnly Property&lt;/span&gt; IsMicrosoftAjaxAvailable() &lt;span class=kwd&gt;As Boolean
        Get&lt;/span&gt;
            InitializeHelper()
            &lt;span class=kwd&gt;Return&lt;/span&gt; mbIsMicrosoftAjaxAvailable
        &lt;span class=kwd&gt;End Get
    End Property
End Class&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;Here's how I use this from my server control code:&lt;/p&gt;&lt;pre class=coloredcode&gt;    &lt;span class=kwd&gt;Protected Overrides Sub&lt;/span&gt; OnPreRender(&lt;span class=kwd&gt;ByVal&lt;/span&gt; e &lt;span class=kwd&gt;As&lt;/span&gt; System.EventArgs)
        &lt;span class=kwd&gt;MyBase&lt;/span&gt;.OnPreRender(e)
        &lt;span class=cmt&gt;'ScriptManagerHelper.RegisterClientScriptResource(Me, GetType(MyControl), "MyControl.js") '            
        '// Register initialization            
&lt;/span&gt;        ScriptManagerHelper.RegisterStartupScript(&lt;span class=kwd&gt;Me&lt;/span&gt;, &lt;span class=kwd&gt;GetType&lt;/span&gt;(MyControl), ClientID + &lt;span class=st&gt;"_Key"&lt;/span&gt;, &lt;span class=st&gt;"MyC_ShowGroup(&lt;span class=cmt&gt;'" &amp;amp; SelectedGroup.ToString &amp;amp; "');", True)
&lt;/span&gt;        If ScriptManagerHelper.IsMicrosoftAjaxAvailable Then
            ScriptManagerHelper.RegisterStartupScript(Me, GetType(MyControl), ClientID + "&lt;/span&gt;_Dispose&lt;span class=st&gt;", "&lt;/span&gt;document.getElementById(&lt;span class=cmt&gt;'" + UniqueID + "').dispose = MyC_Dispose;", True)
&lt;/span&gt;        &lt;span class=kwd&gt;End If
    End Sub&lt;/span&gt;&lt;/pre&gt;&amp;nbsp; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;Enjoy!&amp;nbsp; -Monty&lt;/p&gt;</description></item><item><title>Re: HOWTO: Write controls compatible with UpdatePanel without linking to the ASP.NET AJAX DLL</title><link>http://forums.asp.net/thread/1535516.aspx</link><pubDate>Wed, 17 Jan 2007 04:41:20 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1535516</guid><dc:creator>chetan.sarode</dc:creator><author>chetan.sarode</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1535516.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1535516</wfw:commentRss><description>&lt;p&gt;Nice Article..&lt;/p&gt;
&lt;p&gt;thxn for it [:)}&lt;/p&gt;</description></item><item><title>Re: HOWTO: Write controls compatible with UpdatePanel without linking to the ASP.NET AJAX DLL</title><link>http://forums.asp.net/thread/1500538.aspx</link><pubDate>Mon, 18 Dec 2006 13:34:20 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1500538</guid><dc:creator>infinitevs</dc:creator><author>infinitevs</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1500538.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1500538</wfw:commentRss><description>&lt;p&gt;&lt;blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/p&gt;
&lt;p&gt;In the article look under the section "Implementing Dispose". It dynamically adds an expando named "dispose" to the DOM element that points to a JavaScript function. There are two&amp;nbsp;reasons you can't set the expando declaratively: 1. It's not valid XHTML, and 2. The value would be a string literal instead of an actual function.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;font size=2&gt;
&lt;p&gt;Thanks so much for clarifying this for me Eilon!!! This has helped me no-end, its great&amp;nbsp;I finally have my head around this expando stuff :)&amp;nbsp;Nonetheless I have&amp;nbsp;a question&amp;nbsp;for you, I was wondering if&amp;nbsp;it&amp;nbsp;were possible to use the "scriptmanager.RegisterExpandoAttribute()" method of the scriptmanager to register the expando instead of typing it directly?&lt;/p&gt;
&lt;p&gt;kind regards,&lt;/p&gt;
&lt;p&gt;infin.&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: HOWTO: Write controls compatible with UpdatePanel without linking to the ASP.NET AJAX DLL</title><link>http://forums.asp.net/thread/1499210.aspx</link><pubDate>Sat, 16 Dec 2006 05:51:41 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1499210</guid><dc:creator>cnelson1</dc:creator><author>cnelson1</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1499210.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1499210</wfw:commentRss><description>&lt;p&gt;Thanks for the info, Eilon.&lt;/p&gt;
&lt;p&gt;Do I need to use the dispose function if I am not using attachevent? In my composite controls, I just use this.xxx.Attributes.Add() to attach my javascript to my controls. If there is some kind of dispose I need to use, can you give an example? &lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Carl&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: HOWTO: Write controls compatible with UpdatePanel without linking to the ASP.NET AJAX DLL</title><link>http://forums.asp.net/thread/1478411.aspx</link><pubDate>Tue, 28 Nov 2006 04:37:20 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1478411</guid><dc:creator>yagimay</dc:creator><author>yagimay</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1478411.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1478411</wfw:commentRss><description>&lt;p&gt;Thanks for the great post Eilon.&lt;/p&gt;
&lt;p&gt;I was trying to clarify your post with ASP.NET AJAX Beta 2.&lt;br /&gt;Instead of MathWidget register its scripts via ScriptManager, I&lt;br /&gt;made it register via Page.ClientScript. I meant to ensure the control&lt;br /&gt;not work on UpdatePanel unless it register its scripts via ScriptManager.&lt;/p&gt;
&lt;p&gt;However it seems to work even when the scripts are registered via Page.ClientScript.&lt;br /&gt;Is the post still valid with Beta 2 or has there been any enhancement ?&lt;/p&gt;
&lt;p&gt;Here is what I do.&lt;/p&gt;
&lt;p&gt;1. Modify MathWidget.cs to register scripts via Page.ClientScript.&lt;br /&gt;------------------------------------------&lt;br /&gt;&amp;nbsp;MathWidget.cs&lt;br /&gt;------------------------------------------&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected override void OnPreRender(EventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base.OnPreRender(e);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Register script library&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Page.ClientScript.RegisterClientScriptResource(&lt;br /&gt;&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;&amp;nbsp; typeof(MathWidget),&lt;br /&gt;&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;&amp;nbsp; "MathWizard.MathWidget.js");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Register initialization&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Page.ClientScript.RegisterStartupScript(&lt;br /&gt;&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;&amp;nbsp; typeof(MathWidget),&lt;br /&gt;&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;&amp;nbsp; ClientID + "_KeyStuff",&lt;br /&gt;&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;&amp;nbsp; "MathWidget_Initialize('" + ClientID + "');",&lt;br /&gt;&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;&amp;nbsp; true);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;2. (a) Generate WebForm and add UpdatePanel.&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;(b) Place MathWidget, Button and Label on UpdatePanel.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (c) Add following code (Button1.Click returns current time). &lt;br /&gt;------------------------------------------&lt;br /&gt;&amp;nbsp;Default.aspx.cs&lt;br /&gt;------------------------------------------&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void Button1_Click(object sender, EventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Label1.Text = DateTime.Now.ToString();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;3. Debug WebForm.&lt;br /&gt;&amp;nbsp;&amp;nbsp; (a) Make sure MathWidget works.&lt;br /&gt;&amp;nbsp;&amp;nbsp; (b) Click Button. --- Label displays current time.&lt;br /&gt;&amp;nbsp;&amp;nbsp; (c) MathWidget still works.&lt;/p&gt;</description></item><item><title>Re: HOWTO: Write controls compatible with UpdatePanel without linking to the ASP.NET AJAX DLL</title><link>http://forums.asp.net/thread/1467648.aspx</link><pubDate>Thu, 16 Nov 2006 17:06:58 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1467648</guid><dc:creator>Eilon</dc:creator><author>Eilon</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1467648.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1467648</wfw:commentRss><description>&lt;p&gt;In the article look under the section "Implementing Dispose". It dynamically adds an expando named "dispose" to the DOM element that points to a JavaScript function. There are two&amp;nbsp;reasons you can't set the expando declaratively: 1. It's not valid XHTML, and 2. The value would be a string literal instead of an actual function.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Eilon&lt;/p&gt;</description></item><item><title>Re: HOWTO: Write controls compatible with UpdatePanel without linking to the ASP.NET AJAX DLL</title><link>http://forums.asp.net/thread/1467394.aspx</link><pubDate>Thu, 16 Nov 2006 14:50:56 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1467394</guid><dc:creator>infinitevs</dc:creator><author>infinitevs</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1467394.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1467394</wfw:commentRss><description>&lt;p&gt;Thanks eilon I appreciate the feedback, but can you please give me an example in code of what you mean? By expando do you mean, &amp;lt;element dispose="dispose" /&amp;gt; and if so how does one implement this, a simple example would be greatly appreciated..&lt;/p&gt;
&lt;p&gt;thanks in advance,&lt;/p&gt;
&lt;p&gt;kind regards,&lt;/p&gt;
&lt;p&gt;infin.&lt;/p&gt;</description></item><item><title>Re: HOWTO: Write controls compatible with UpdatePanel without linking to the ASP.NET AJAX DLL</title><link>http://forums.asp.net/thread/1466486.aspx</link><pubDate>Wed, 15 Nov 2006 23:34:14 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1466486</guid><dc:creator>Eilon</dc:creator><author>Eilon</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1466486.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1466486</wfw:commentRss><description>&lt;p&gt;The dispose expando is used to detach any resources that your control is using. If you don't implement dispose you could experience problems ranging from memory leaks to JavaScript errors to other broken behavior. The PageRequestManager (the client-side "brains" of UpdatePanel) will scan the DOM inside the UpdatePanel for elements supporting "dispose" functionality and invoke those methods to give them a chance to clean up their resources.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Eilon&lt;/p&gt;</description></item></channel></rss>