在ajax中的UpdatePanel弹出对话窗,可以使用:
ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "alert", "alert('更新成功!')", true);
修改后跳到另一个页面中去时,可以使用:
ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "click", "location.replace('UserManger.aspx');", true);
如果跳转前还有提示信息的话,则可以使用:
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "click", "alert('更新成功!');location.replace('UserManger.aspx');", true);
例如:ScriptManager.RegisterStartupScript(this.UpdatePanel1,this.GetType(), "提示", "alert('购物车为空,请先购物!')", true);
protected void UpdatePanelAlert(string str_Message)
{
ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "提示", "alert('" + str_Message+ "')", true);
}
{
ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "提示", "alert('" + str_Message+ "')", true);
}
UpdatePanelAlert("无此代码");
asp.net ajax框架UpdatePanel弹出提示的几种方法
|
1、 dt.Rows.Add(tmpdt.Rows[0].ItemArray);
2、 dt.ImportRow(tmpdt.Rows[0]); |