Error when not using embedded scripts for ListBox

2 posts, 1 answers
  1. Hosney
    Hosney avatar
    1 posts
    Member since:
    Aug 2015

    Posted 08 Sep 2015 Link to this post

    I get the following error when not using embedded scripts for the RadListBox

    Uncaught TypeError: Cannot read property 'Classic' of undefined.

    I'm using Telerik version 2015.1.225.40.

    Sample code

    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryPlugins.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Navigation.NavigationScripts.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.ListBox.RadListBoxScripts.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.TouchScrollExtender.js" />              
        <telerik:RadListBox ID="lstPermitStatuses" Width="313px" Height="100px" runat="server" EnableEmbeddedScripts="False">
                <telerik:RadListBoxItem Text="Item1" runat="server" />
                <telerik:RadListBoxItem Text="Item2" runat="server" />
                <telerik:RadListBoxItem Text="Item3" runat="server" />
                <telerik:RadListBoxItem Text="Item4" runat="server" />
                <telerik:RadListBoxItem Text="Item5" runat="server" />

    Please let me know how this can be fixed without using embedded scripts.

  2. Answer
    Dimitar avatar
    276 posts

    Posted 09 Sep 2015 Link to this post


    You need to add two more script references to overcome this error. The following scripts would load needed resources for cases of Classic render mode and Lightweight render mode:

    Copy Code
    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.ListBox.RadListBoxScripts.js" />
    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.ListBox.Views.ClassicView.js" />
    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.ListBox.Views.LiteView.js" />
    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.TouchScrollExtender.js" />

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
Back to Top