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

Javascript error while disabling embedded scripts

4 Answers 172 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bhavin
Top achievements
Rank 1
Bhavin asked on 11 Aug 2009, 04:12 PM
When disabling embedded scripts for the telerik controls and including the script reference paths manually, javascript errors occur and sometimes controls are got getting rendered correctly.

We are adding following javascripts manually in the same sequence:

~/scripts/Common/Core.js
~/scripts/Common/Animation/AnimationScripts.js
~/scripts/Common/Navigation/NavigationScripts.js
~/scripts/Common/Scrolling/ScrollingScripts.js
~/scripts/Common/PopUp/PopUpScripts.js
~/scripts/ComboBox/RadComboBoxScripts.js
~/scripts/Grid/RadGridScripts.js
~/scripts/Menu/RadMenuScripts.js
~/scripts/Editor/RadEditor.js
~/scripts/Dialogs/DialogOpener.js
~/scripts/Editor/Modules.js
~/scripts/Spell/SpellCheckService.js
~/scripts/Editor/AjaxSpellCheck.js
~/scripts/Window/RadWindow.js
~/scripts/ToolBar/RadToolBarScripts.js
~/scripts/Splitter/RadSplitter.js
~/scripts/Splitter/SplitterItem.js
~/scripts/Splitter/SplitterPaneBase.js
~/scripts/Splitter/RadPane.js
~/scripts/Splitter/RadSlidingPane.js
~/scripts/Splitter/RadSlidingZone.js
~/scripts/Splitter/RadSplitBar.js
~/scripts/TreeView/RadTreeViewScripts.js

On a particular page, we are using RadMenu, RadToolbar, RadSplitter, RadGrid, RadEditor and RadComboBox controls. While loading a page, we get javascript error - "Sys.ArgumentException:  does not derive from Sys.Component. Parameter name: type". Also, RadSplitter is not getting rendered on the page. However, RadMenu and RadToolbar are getting rendered correctly.

Other pages, where we are using RadEditor and/or RadComboBox, there is no error. Everything works fine.

We suspect some javascript files are missing for splitter or sequence is not correct. Please suggest.

Note that we are using RadControls for ASPNET AJAX Q2 2008.

Thanks,
Bhavin

4 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 14 Aug 2009, 10:52 AM
Hello Bhavin,

When disabling embedded respurces, please go through the following article:

http://www.telerik.com/help/aspnet-ajax/disabling_embedded_resources.html

As you can see there, e.g for the splitter, you have referenced not needed js files and you have not referenced others - the references for the splitter should be:

<Scripts> 
   <asp:ScriptReference Path="~/Scripts/Common/Core.js" /> 
   <asp:ScriptReference Path="~/Scripts/Common/jQuery.js" /> 
   <asp:ScriptReference Path="~/Scripts/Common/jQueryPlugins.js" /> 
   <asp:ScriptReference Path="~/Scripts/Common/Popup/PopupScripts.js" /> 
   <asp:ScriptReference Path="~/Scripts/Common/Navigation/NavigationScripts.js" /> 
   <asp:ScriptReference Path="~/Scripts/Splitter/RadSplitterScripts.js" /> 
   <asp:ScriptReference Path="~/Scripts/Splitter/RadSlidingZoneScripts.js" /> 
</Scripts>  

where the jQuery scripts are needed if you are using Q1 2009 or later (in your thread you have noted Q2 and if this is correct, you should reference them as shown above).

The provided article contains information about other controls, too. When you disable the resources for multiple controls, I recommend to start with the common files which are in the Common folder.

I hope that the provided information is helpful, let us know if you need further assistance.

Regards,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Bhavin
Top achievements
Rank 1
answered on 14 Aug 2009, 03:54 PM
We are using RadControls for ASPNET AJAX Q2 2008. It has following JS files for splitter:
  ~/scripts/Splitter/RadSplitter.js
  ~/scripts/Splitter/SplitterItem.js
  ~/scripts/Splitter/SplitterPaneBase.js
  ~/scripts/Splitter/RadPane.js
  ~/scripts/Splitter/RadSlidingPane.js
  ~/scripts/Splitter/RadSlidingZone.js
  ~/scripts/Splitter/RadSplitBar.js

RadControls for ASPNET AJAX Q2 2008 does not have following JS files for splitter as mentioned by you:
  ~/Scripts/Splitter/RadSplitterScripts.js
  ~/Scripts/Splitter/RadSlidingZoneScripts.js

It seems that above two JS files are part of Q1 2009 release along with jQuery scripts.
0
Svetlina Anati
Telerik team
answered on 18 Aug 2009, 12:55 PM
Hello Bhavin,

I apologize for missing the fact that you are using Q2 2008 release - I now noticed that you have said this but when building your demo I looked at the textbox for version and it says Q2 2009 - this caused the misunderstanding. In order to make the splitter work you should use the following script references:

 <form id="form1" runat="server">  
        <asp:ScriptManager ID="ScriptManager1" runat="server">  
            <Scripts> 
                <asp:ScriptReference Path="~/Scripts/Common/Core.js" /> 
                <asp:ScriptReference Path="~/Scripts/Common/Animation/AnimationScripts.js" /> 
                <asp:ScriptReference Path="~/Scripts/Common/Navigation/NavigationScripts.js" /> 
                <asp:ScriptReference Path="~/Scripts/Common/Scrolling/ScrollingScripts.js" /> 
                <asp:ScriptReference Path="~/Scripts/Common/Popup/PopupScripts.js" /> 
                <asp:ScriptReference Path="~/Scripts/Splitter/SplitterItem.js" /> 
                <asp:ScriptReference Path="~/Scripts/Splitter/SplitterPaneBase.js" /> 
                <asp:ScriptReference Path="~/Scripts/Splitter/RadPane.js" /> 
                <asp:ScriptReference Path="~/Scripts/Splitter/RadSlidingPane.js" /> 
                <asp:ScriptReference Path="~/Scripts/Splitter/RadSlidingZone.js" /> 
                <asp:ScriptReference Path="~/Scripts/Splitter/RadSplitBar.js" /> 
                <asp:ScriptReference Path="~/Scripts/Splitter/RadSplitter.js" /> 
            </Scripts> 
        </asp:ScriptManager> 
        <telerik:RadSplitter ID="RadSplitter1" runat="server" EnableEmbeddedScripts="false">  
            <telerik:RadPane ID="RadPane1" runat="server" Width="22" EnableEmbeddedScripts="false">  
                <telerik:RadSlidingZone ID="zone" runat="server" EnableEmbeddedScripts="false">  
                    <telerik:RadSlidingPane ID="slideingPane1" runat="server" Title="Test" EnableEmbeddedScripts="false">  
                    </telerik:RadSlidingPane> 
                </telerik:RadSlidingZone> 
            </telerik:RadPane> 
            <telerik:RadSplitBar ID="ss" runat="server" CollapseMode="Both" EnableEmbeddedScripts="false" /> 
            <telerik:RadPane ID="RadPane2" runat="server" EnableEmbeddedScripts="false">  
            </telerik:RadPane> 
        </telerik:RadSplitter> 
    </form> 

Let me iknow whether this fixed the issue.

Best wishes,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Bhavin
Top achievements
Rank 1
answered on 11 Sep 2009, 03:19 PM
Hi Svetlina,
 
Those script files are already added. Please read my first post on 11-Aug-09.

Eventually, we installed Q1 2009 release and managed to make it work.

Thanks,
Bhavin
Tags
General Discussions
Asked by
Bhavin
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Bhavin
Top achievements
Rank 1
Share this question
or