"); var items = combo.get_items(); } As per the above code in JS, I receive the " /> "); var items = combo.get_items(); } As per the above code in JS, I receive the " /> "); var items = combo.get_items(); } As per the above code in JS, I receive the "/>

JavaScript runtime error: Object doesn't support property or method 'get_items'

96 Views Asked by At
   $(window).load(function () {
               var combo = $find("<%=ComboBox.ClientID%>");
               var items = combo.get_items();
    }

As per the above code in JS, I receive the Error as JavaScript runtime error: Object doesn't support property or method 'get_items'

I am using Telerik RadcomboBox.

This issue exist only in window.load() Code Block.

During window.Load() I a getting var combo = $find("<%=ComboBox.ClientID%>"); as Null only in IE

1

There are 1 best solutions below

0
Rumen Jekov On

Using native DOM events (like window.load or jQuery's $(document).ready may not give you the expected results. Such events are usualy prior to the Sys.Application.load event and cannot guarantee that the control instances are initialized.

The UI for ASP.NET AJAX controls are created by implementing the IScriptControl interface and have the lifecycle of MS AJAX-based controls. Thus, they are initialized during the Sys.Application.init event and the instance of the control can be accessed during the Sys.Application.load event at the earliest. You can see how in the Important MS AJAX Events section.

Check out this article for more info: https://docs.telerik.com/devtools/aspnet-ajax/general-information/get-client-side-reference