Tuesday, February 5, 2008

Trigger Javascript inside Ajax Partial Postback called

To run / trigger a javascript after ajax partial postback, We need to register our script in our code behind.

Here is the code :
//To find your script manager which belong to master pages
ScriptManager sm = Master.FindControl("ScriptManager1") as ScriptManager;

ScriptManager.RegisterStartupScript(this, this.GetType(), "title script", string.Format("javascript:window.open(\"{0}\",\"_blank\");", "kajaxnet.blogspot.com"), true);

No comments: