I have to add a radscriptmanager in a base class and I want to combine the script however it doesn't appear to work. I am ensuring that this control is added as the first control of the form. I have the following...
RadScriptManager sm = new RadScriptManager();
sm.ScriptMode = ScriptMode.Release;
ScriptReference telerikCore = new ScriptReference("~/Scripts/Common/Core.js");
ScriptReference jquery = new ScriptReference("~/Scripts/Common/jQuery.js");
ScriptReference jQueryPlugins = new ScriptReference("~/Scripts/Common/jQueryPlugins.js");
ScriptReference navigationScripts = new ScriptReference("~/Scripts/Common/Navigation/NavigationScripts.js");
ScriptReference radMenuScripts = new ScriptReference("~/Scripts/Menu/RadMenuScripts.js");
ScriptReference radCalendarCommonScript = new ScriptReference("~/Scripts/Calendar/RadCalendarCommonScript.js");
ScriptReference radCalendarScript = new ScriptReference("~/Scripts/Calendar/RadCalendarScript.js");
ScriptReference jqueryValidate = new ScriptReference("~/js/jquery.validate.js");
ScriptReference slimStatAnalytics = new ScriptReference("~/slimstat/?js");
sm.Scripts.Add(telerikCore);
sm.Scripts.Add(jquery);
sm.Scripts.Add(jQueryPlugins);
sm.Scripts.Add(navigationScripts);
sm.Scripts.Add(radMenuScripts);
sm.Scripts.Add(radCalendarCommonScript);
sm.Scripts.Add(radCalendarScript);
sm.Scripts.Add(jqueryValidate);
sm.Scripts.Add(slimStatAnalytics);
sm.EnableScriptCombine = true;
sm.EnablePageMethods = true;
sm.OutputCompression = OutputCompression.AutoDetect;
form.Controls.AddAt(0, sm);
I get a Telerik.Web.UI.WebResource.axd file containing 10,000 lines of code which looks like Ms Ajax related js - no reference to Telerik in there at all. My page still contains the scripts as separate links. Do I need to set enableembeddedscripts to false on all my rad controls? How about the RegisterWithScriptManager property on radmenu?
If I create another page and do this in mark up it works fine. What am I doing wrong? I don't suppose you have an example of this working?
Thanks
Matt
RadScriptManager sm = new RadScriptManager();
sm.ScriptMode = ScriptMode.Release;
ScriptReference telerikCore = new ScriptReference("~/Scripts/Common/Core.js");
ScriptReference jquery = new ScriptReference("~/Scripts/Common/jQuery.js");
ScriptReference jQueryPlugins = new ScriptReference("~/Scripts/Common/jQueryPlugins.js");
ScriptReference navigationScripts = new ScriptReference("~/Scripts/Common/Navigation/NavigationScripts.js");
ScriptReference radMenuScripts = new ScriptReference("~/Scripts/Menu/RadMenuScripts.js");
ScriptReference radCalendarCommonScript = new ScriptReference("~/Scripts/Calendar/RadCalendarCommonScript.js");
ScriptReference radCalendarScript = new ScriptReference("~/Scripts/Calendar/RadCalendarScript.js");
ScriptReference jqueryValidate = new ScriptReference("~/js/jquery.validate.js");
ScriptReference slimStatAnalytics = new ScriptReference("~/slimstat/?js");
sm.Scripts.Add(telerikCore);
sm.Scripts.Add(jquery);
sm.Scripts.Add(jQueryPlugins);
sm.Scripts.Add(navigationScripts);
sm.Scripts.Add(radMenuScripts);
sm.Scripts.Add(radCalendarCommonScript);
sm.Scripts.Add(radCalendarScript);
sm.Scripts.Add(jqueryValidate);
sm.Scripts.Add(slimStatAnalytics);
sm.EnableScriptCombine = true;
sm.EnablePageMethods = true;
sm.OutputCompression = OutputCompression.AutoDetect;
form.Controls.AddAt(0, sm);
I get a Telerik.Web.UI.WebResource.axd file containing 10,000 lines of code which looks like Ms Ajax related js - no reference to Telerik in there at all. My page still contains the scripts as separate links. Do I need to set enableembeddedscripts to false on all my rad controls? How about the RegisterWithScriptManager property on radmenu?
If I create another page and do this in mark up it works fine. What am I doing wrong? I don't suppose you have an example of this working?
Thanks
Matt