方法1
Page.RegisterStartupScript("js名","js内容");
eg:
方法2:
string js = "<scripttype='text/javascript'> parent.pzgl.location.reload(); </script>";
ClientScript.RegisterStartupScript(GetType(),"refreshTree", js);
方法3
当页面中有<asp:UpdatePanel> </asp:UpdatePanel>控件时:
ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('保存成功!');", true);