Ejemplo n.º 1
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 ///   AddScriptManager is used internally by the framework to add a ScriptManager control to the page
 /// </summary>
 /// <remarks>
 /// </remarks>
 /// <history>
 /// </history>
 /// -----------------------------------------------------------------------------
 public static void AddScriptManager(Page objPage)
 {
     if (GetScriptManager(objPage) == null)
     {
         using (var objScriptManager = new Telerik.Web.UI.RadScriptManager {
             ID = "ScriptManager", EnableScriptGlobalization = true, SupportsPartialRendering = true
         })
         {
             if (objPage.Form != null)
             {
                 try
                 {
                     objPage.Form.Controls.AddAt(0, objScriptManager);
                 }
                 catch
                 {
                     //suppress error adding script manager to support edge-case of module developers custom aspx pages that inherit from basepage and use code blocks
                 }
                 if (HttpContext.Current.Items["System.Web.UI.ScriptManager"] == null)
                 {
                     HttpContext.Current.Items.Add("System.Web.UI.ScriptManager", true);
                 }
             }
         }
         using (var objStylesheetManager = new Telerik.Web.UI.RadStyleSheetManager {
             ID = "StylesheetManager",
         })
         {
             if (objPage.Form != null)
             {
                 try
                 {
                     objPage.Form.Controls.AddAt(0, objStylesheetManager);
                 }
                 catch
                 {
                     //suppress error adding script manager to support edge-case of module developers custom aspx pages that inherit from basepage and use code blocks
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
Archivo: AJAX.cs Proyecto: biganth/Curt
 /// -----------------------------------------------------------------------------
 /// <summary>
 ///   AddScriptManager is used internally by the framework to add a ScriptManager control to the page
 /// </summary>
 /// <remarks>
 /// </remarks>
 /// <history>
 /// </history>
 /// -----------------------------------------------------------------------------
 public static void AddScriptManager(Page objPage)
 {
     if (GetScriptManager(objPage) == null)
     {
         using (var objScriptManager = new Telerik.Web.UI.RadScriptManager { ID = "ScriptManager", EnableScriptGlobalization = true, SupportsPartialRendering = true})
         {
             if (objPage.Form != null)
             {
                 try
                 {
                     objPage.Form.Controls.AddAt(0, objScriptManager);
                 }
                 catch
                 {
                     //suppress error adding script manager to support edge-case of module developers custom aspx pages that inherit from basepage and use code blocks
                 }
                 if (HttpContext.Current.Items["System.Web.UI.ScriptManager"] == null)
                 {
                     HttpContext.Current.Items.Add("System.Web.UI.ScriptManager", true);
                 }
             }
         }
         using (var objStylesheetManager = new Telerik.Web.UI.RadStyleSheetManager { ID = "StylesheetManager", })
         {
             if (objPage.Form != null)
             {
                 try
                 {
                     objPage.Form.Controls.AddAt(0, objStylesheetManager);
                 }
                 catch
                 {
                     //suppress error adding script manager to support edge-case of module developers custom aspx pages that inherit from basepage and use code blocks
                 }
             }
         }
     }
 }