How to get the ScriptManager of Master Page into Child page's code behind c# (.cs) file

Imran Rizvi picture Imran Rizvi · Dec 22, 2011 · Viewed 29.1k times · Source

Following is the web site environment I created:

  1. I have a Master page.
  2. I have created a Child page from it.
  3. I have placed Script Manager on the Master page.

Now I want to access that Master page's Script Manager to create a User Control dynamically in my code behind (C#) file.

How can I access Script Manager placed on master page to my child page.

Answer

Imran Rizvi picture Imran Rizvi · Sep 19, 2012

I got it, its given in ScriptManager class itself.

System.Web.UI.ScriptManager.GetCurrent(this.Page);