I have VS2008 webapp that dynamically loads usercontrols.
The masterpage has an instance of RadScriptManager and RadAjaxManager and each control has a RadAjaxManager proxy.
Without enabling Ajax on the master page, everything works properly.
With Ajax enabled on the masterpage everything still works - except the jscript on the 2nd and subsequent loaded usercontrols. The jscript on the first control loaded works correctly, but controls 2-x return 'undefined' errors on all of the jscript methods contained within the controls. If I change the order of the controls, the first one always works and 2-x do not.
I've read posts about using the ScriptManager.RegisterStartupScript, but some of these controls have a considerable amount of jscript and trying to maintain that within the context of the serverside code as a string isn't feasible, not to mention the debugging issues it presents. Also, while simple jscript functions via .RegisterStartupScript seem to work ok, I am getting null references on any objects that I try and reference (either using $find or document.getElementById('<%=controlID.ClientID%>'); within those usercontrols.
Is it possible to get the jscript within all the usercontrols to work properly when loaded via Ajax?
The masterpage has an instance of RadScriptManager and RadAjaxManager and each control has a RadAjaxManager proxy.
Without enabling Ajax on the master page, everything works properly.
With Ajax enabled on the masterpage everything still works - except the jscript on the 2nd and subsequent loaded usercontrols. The jscript on the first control loaded works correctly, but controls 2-x return 'undefined' errors on all of the jscript methods contained within the controls. If I change the order of the controls, the first one always works and 2-x do not.
I've read posts about using the ScriptManager.RegisterStartupScript, but some of these controls have a considerable amount of jscript and trying to maintain that within the context of the serverside code as a string isn't feasible, not to mention the debugging issues it presents. Also, while simple jscript functions via .RegisterStartupScript seem to work ok, I am getting null references on any objects that I try and reference (either using $find or document.getElementById('<%=controlID.ClientID%>'); within those usercontrols.
Is it possible to get the jscript within all the usercontrols to work properly when loaded via Ajax?