日期:2014-05-16 浏览次数:20474 次
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
protected void Button1_Click(object sender, EventArgs e)
{
Page.ClientScript.RegisterClientScriptBlock(e.GetType(), "aaa", "alert('删除失败')", true);
Response.Redirect("Target.aspx", false);
}
/// <summary>
/// 弹出对话框 并且跳转界面
/// </summary>
/// <param name="page">Page或者this</param>
/// <param name="str">值 如'登陆成功!'</param>
/// <param name="url">要跳转的界面 如'admin/main.aspx'</param>
public static void show(Page page, string str, string url)
{
page.ClientScript.RegisterStartupScript(page.GetType(), "", "<script language=javascript>alert('" + str + "');location.href='" + url + "';</script>");
}