Object reference not set to an instance of an object

Ruslan's ASP .NET weblog

When AJAX ScriptManager is on MasterPage

..and we need to access it:

ScriptManager ScriptManager1 = (ScriptManager)Master.FindControl("ScriptManager1");
ScriptManager1.AsyncPostBackTimeout = 300;

..or a much beter way:

ScriptManager ScriptManager1 = ScriptManager.GetCurrent(this);

suggested by rajbk

Comments

rajbk said:

Consider using ScriptManager.GetCurrent(Page)

msdn2.microsoft.com/.../system.web.ui.scriptmanager.getcurrent.aspx

# March 13, 2008 2:33 PM

Richard said:

Take a look at the ScriptManagerProxy control:

www.asp.net/.../T_System_Web_UI_ScriptManagerProxy.aspx

# March 13, 2008 7:33 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)