ASP.NET Call JavaScript from UpdatePanel

In my case ScriptManager was initialized in Master.Master Page. Any try using ScriptManager.RegisterClientScriptBlock() failed bacuese of missing AJAX references.
One approach is described here.
My solution was to download AJAX library, adding a reference to it and code below:

protected void FlagTopic_Click(object sender, EventArgs e){     if (AjaxControlToolkit.ToolkitScriptManager.GetCurrent(this.Page) != null && AjaxControlToolkit.ToolkitScriptManager.GetCurrent(this.Page).IsInAsyncPostBack)    {        AjaxControlToolkit.ToolkitScriptManager.RegisterStartupScript(this, this.GetType(), "Initialize", "fireModal();", true);    }}

If you cannot use code like


Change it to this


Leave a Reply

Your email address will not be published. Required fields are marked *