Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 public static bool IsMicrosoftAjaxAvailable()
 {
     ScriptManagerHelper.InitializeReflection();
     return(ScriptManagerHelper.RegisterStartupScriptMethod != null);
 }