public static void RegisterStartupScript(Control control, Type type, string key, string script, bool addScriptTags) { if (control == null) { throw new ArgumentNullException("control"); } if (control.Page == null) { throw new ArgumentException("The control must be on a page.", "control"); } ScriptManagerHelper.InitializeReflection(); if (ScriptManagerHelper.RegisterStartupScriptMethod != null) { ScriptManagerHelper.RegisterStartupScriptMethod.Invoke(null, new object[] { control.Page, type, key, script, addScriptTags }); return; } control.Page.ClientScript.RegisterStartupScript(type, key, script, addScriptTags); }
public static void RegisterClientScriptInclude(Control control, Type type, string key, string url) { if (control == null) { throw new ArgumentNullException("control"); } if (control.Page == null) { throw new ArgumentException("The control must be on a page.", "control"); } ScriptManagerHelper.InitializeReflection(); if (ScriptManagerHelper.RegisterClientScriptIncludeMethod != null) { ScriptManagerHelper.RegisterClientScriptIncludeMethod.Invoke(null, new object[] { control.Page, type, key, url }); return; } control.Page.ClientScript.RegisterClientScriptInclude(type, key, url); }
public static bool IsMicrosoftAjaxAvailable() { ScriptManagerHelper.InitializeReflection(); return(ScriptManagerHelper.RegisterStartupScriptMethod != null); }