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

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


I got it, its given in ScriptManager class itself.

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


Not sure what exactly you want here... you want to access the script manager of your master page or just the masterpage?

You can access the master page by Page.Master in code behind

Or

using System.Web.UI;ScriptManager ScriptManager1 = (ScriptManager)Page.Master.FindControl("ScriptManager1") // to access the script manager of master page

or

Page.Master.Controls.Add(Your UserControl object) // to add the user control in your master page


Have you checked out this:

Working with ASP.NET Master Pages Programmatically
http://msdn.microsoft.com/en-us/library/c8y19k6h.aspx