How To Replace ScriptManager With RadScriptManager When



TODO:

Have you ever wanted to replace the ScriptManager that is in the master page with the RadScriptManager?  The code below will do just this for you!

 

SOLUTION:

protected override void OnInit(EventArgs e)
{
      Page.Init += delegate(object sender,EventArgs e_Init)
      {
            if(ScriptManager.GetCurrent(Page) != null)
            {
                    Page.Items.Remove(typeof(ScriptManager));
                    Telerik.Web.UI.RadScriptManagerscriptManager = new RadScriptManager();
                    Page.Form.Controls.AddAt(0, scriptManager);
             }
       };
       base.OnInit(e);
}

NOTES:

There are no notes on this topic.



Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading