RegisterStartupScript doesn’t work with ScriptManager,Updatepanel. Why is that?

When you use an UpdatePanel, then you can not call JavaScript using ClientScript as you have tried to. You have to use ScriptManager.RegisterStartupScript instead. So change your Page.ClientScript.RegisterStartupScript(this.GetType(), “myKey”, javaScript); to ScriptManager.RegisterStartupScript(updatePanelId,updatePanelId.GetType(), “alert”, javaScript, true);