Hello,
Let me try to explain the subject. I have a page with RadAjaxManager and need to get hold of it when application initially loads. I am doing it like that:
problem is that it works fine when I open page in localhost, like http://localhost. However, when I change localhost to something else (like http://sameMachine), it can't get it and returns null.
Here is sample page:
Please advise.
Thanks,
Nick
Let me try to explain the subject. I have a page with RadAjaxManager and need to get hold of it when application initially loads. I am doing it like that:
var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(this).ClientID %>");problem is that it works fine when I open page in localhost, like http://localhost. However, when I change localhost to something else (like http://sameMachine), it can't get it and returns null.
Here is sample page:
<html lang="en"><head id="Head1" runat="server"> <meta charset="utf-8" /> <title>Blah</title></head><body> <form id="form1" class="form" runat="server"> <telerik:RadScriptManager ID="ScriptManager" runat="server" EnablePageMethods="True" EnableTheming="True"> </telerik:RadScriptManager> <div id="Div1" class="page" runat="server"> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel" runat="server" Skin="Sitefinity" /> <telerik:RadAjaxManager ID="RadAjaxManager" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="testButton"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="testButton" UpdatePanelHeight="" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <asp:Button ID="testButton" runat="server" Text="Test Me" OnClientClick="TestMe('button');" /> </div> <script type="text/javascript"> function TestMe(argument) { var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(this).ClientID %>"); if (ajaxManager == null) { alert('NULL. called by ' + argument); } else { alert('Got it from ' + argument); } } window.attachEvent("onload", function () { // will work fine if run on localhost TestMe('window.onload'); }); </script> </form></body></html>Please advise.
Thanks,
Nick