Tuesday, October 5, 2010

Script controls may not be registered before PreRender

Place the code in the code behind and run
protected override void OnInit(EventArgs e)
{
if (ScriptManager.GetCurrent(this.Page) == null)
{
scriptManager = new ScriptManager();
scriptManager.ID = “myScriptManager”;
scriptManager.EnablePartialRendering = true;
this.Page.Form.Controls.Add(scriptManager);
}
base.OnInit(e);
}

No comments:

Post a Comment