/// <summary> /// Registers an external script url on this page. /// </summary> /// <param name="location">Specifies whether the script should be added to the page header. If False, it will be added to the </param> public void RegisterScriptFile(string scriptUrl, ScriptInsertLocation location = ScriptInsertLocation.FormBottom) { lock (RegisteredScriptFiles) { if (!RegisteredScriptFiles.ContainsKey(scriptUrl)) { RegisteredScriptFiles.Add(scriptUrl, location); } } }
/// <summary> /// Registers an external script url on this page. /// </summary> /// <param name="location">Specifies whether the script should be added to the page header. If False, it will be added to the </param> public static void RegisterScriptFile(this System.Web.UI.UserControl module, string scriptUrl, ScriptInsertLocation location = ScriptInsertLocation.FormBottom) { var mSharpPage = module.Page as MSharp.Framework.UI.Page; if (mSharpPage == null) { throw new InvalidOperationException("The page of this module is not MSharp.Framework.UI.Page."); } mSharpPage.RegisterScriptFile(scriptUrl, location); }