Thursday 2 December 2010

Using the ScriptManager of Master page in content page

This can be done using ScriptManager.GetCurrent() method.

Use this static method to determine whether a ScriptManager control is on a page, or to access the properties and methods of a ScriptManager control when you do not know its ID.


ScriptManager scriptManager;

if (ScriptManager.GetCurrent(Page) == null)
{
scriptManager = new ScriptManager();
scriptManager .ID = "ScriptManager1";
}
else
{
scriptManager = ScriptManager.GetCurrent(Page);
}

No comments:

Post a Comment