This is a migrated thread and some comments may be shown as answers.

Error when not using embedded scripts for ListBox

1 Answer 35 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Hosney
Top achievements
Rank 1
Hosney asked on 09 Sep 2015, 04:10 AM

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">
        <Scripts>
            <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" />              
        </Scripts>
    </telerik:RadScriptManager>
<div>
    <telerik:RadListBox ID="lstPermitStatuses" Width="313px" Height="100px" runat="server" EnableEmbeddedScripts="False">
        <Items>
            <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" />
        </Items>
    </telerik:RadListBox>
</div>
</form>


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

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 09 Sep 2015, 08:00 AM
Hi,

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" />
...


Regards,
Dimitar
Telerik
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
Tags
ListBox
Asked by
Hosney
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or