日期:2014-05-20  浏览次数:20395 次

弹出"保存成功"后转向另外一个网页怎么做?
C# code
protected void btnSave_Click(object sender, EventArgs e)
{
    string script = @"<script language=javascript type=text/javascript>alert('保存成功')</script>"
    Response.Redirect("~/Modify.aspx",false);
}


这样做直接转向Modify.aspx页面,并没有弹出"保存成功"对话框。
请问如何实现弹出"保存成功"对话框后再转向Modify.aspx页面(这两个操作要在一个事件中完成。)

------解决方案--------------------
C# code

protected void btnSave_Click(object sender, EventArgs e) 
{
    this.ClientScript.RegisterStartupScript(typeof(string),"success","alert('保存成功');window.location.href='Modify.aspx';",true);
}

------解决方案--------------------
探讨
C# code
protected void btnSave_Click(object sender, EventArgs e)
{
this.ClientScript.RegisterStartupScript(typeof(string),"success","alert('保存成功');window.location.href='Modify.aspx';",true);
}

------解决方案--------------------
探讨
C# code
protected void btnSave_Click(object sender, EventArgs e)
{
this.ClientScript.RegisterStartupScript(typeof(string),"success","alert('保存成功');window.location.href='Modify.aspx';",true);
}