Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Can't find MS AJAX prototype object

$
0
0

Hi guys,

I've created a few web custom controls enhanced with some client capabilites (using MS AJAX prototype Sys.UI.Behavior). The web controls each implement the IScriptControl interface so that initializing the client AJAX control happens automatically by ASP.NET thanks to the GetScriptReferences() and GetScriptDescriptors() methods. Thes web controls sit inside an UpdatePanel and work like a charm. However a manually registered client script which tries to access the client prototype object using the $find() method returns NULL. The manual script is registered as

ScriptManager.RegisterStartupScript(Page, typeof(ControlWithFullNameSpace), "key1", "CallMyMethod('ControlBehaviorID')", true);

I know the Sys.Application scripts are added by ASP.NET to the end of the html form from what I read from the MSDN documentation. So my thinking is that the manual script tries to access the prototype object too early as the Sys.Application.add_init() didn't create the client objects yet. The ControlBehaviorID works properly as after loading the page an <button /> click script can actually find the prototype object.

Did someone have similar issues?


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>