I'm trying to combine multiple js file references using Telerik's script manager. Here is the code I have on page load:
System.Web.UI.ScriptReference jsFile1 = new System.Web.UI.ScriptReference('/virtual_folder/jsfile1.js');
System.Web.UI.ScriptReference jsFile2 = new System.Web.UI.ScriptReference('/virtual_folder/jsfile2.js');
this.Master.ScriptManager.CompositeScript.Scripts.Add(jsFile1);
this.Master.ScriptManager.CompositeScript.Scripts.Add(jsFile2);
I'm getting an error:
[NullReferenceException: Object reference not set to an instance of an object.] System.Collections.ObjectModel.Collection`1.Add(T item) +18
Telerik.Web.UI.RadScriptManager.Page_PreRenderComplete(Object sender, EventArgs e) +95
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +8695102
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1029
What am I doing wrong?