Object reference not set to an instance of an object

Ruslan's ASP .NET weblog

March 2008 - Posts

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

JavaScript img preload

Not sure if this is the best method, but this is the one I used to preload the image.

 

<script type="text/javascript">

if (document.images)

     {

imgPreload = new Image();

imgPreload.src = "../Images/ajax-loader.gif";

}

</script>

More Posts