弹出"保存成功"后转向另外一个网页怎么做?

zhu4139365 2009-04-15 01:50:54
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页面(这两个操作要在一个事件中完成。)
...全文
160 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
renguanqingyjs1 2011-12-01
  • 打赏
  • 举报
回复
rsponse.write " <script LANGUAGE= 'javascript '> alert( '提交成功! ');window.location.href= 'index.asp ' </script
java_renyusheng 2009-04-15
  • 打赏
  • 举报
回复

string script = @"<script language=javascript type=text/javascript>alert('保存成功');window.location.href('Modify.aspx');</script>"
Response.write(script);
zhu4139365 2009-04-15
  • 打赏
  • 举报
回复
感谢!!!
itcrazyman 2009-04-15
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 zhu4139365 的回复:]
刚才少些一行

C# code
protected void btnSave_Click(object sender, EventArgs e)
{
string script = @"<script language=javascript type=text/javascript>alert('保存成功')</script>";
Response.Write(script);
Response.Redirect("~/Modify.aspx",false);
}
[/Quote]
up
itliyi 2009-04-15
  • 打赏
  • 举报
回复
楼上正解
zhu4139365 2009-04-15
  • 打赏
  • 举报
回复
刚才少些一行

protected void btnSave_Click(object sender, EventArgs e)
{
string script = @"<script language=javascript type=text/javascript>alert('保存成功')</script>";
Response.Write(script);
Response.Redirect("~/Modify.aspx",false);
}
cwmwss 2009-04-15
  • 打赏
  • 举报
回复
UP
ak8800 2009-04-15
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 ojlovecd 的回复:]
C# code
protected void btnSave_Click(object sender, EventArgs e)
{
this.ClientScript.RegisterStartupScript(typeof(string),"success","alert('保存成功');window.location.href='Modify.aspx';",true);
}
[/Quote]
正解
fengxuanll 2009-04-15
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 ojlovecd 的回复:]
C# code
protected void btnSave_Click(object sender, EventArgs e)
{
this.ClientScript.RegisterStartupScript(typeof(string),"success","alert('保存成功');window.location.href='Modify.aspx';",true);
}
[/Quote]
CeShenBeiWang 2009-04-15
  • 打赏
  • 举报
回复
up
wzh307 2009-04-15
  • 打赏
  • 举报
回复

string script = @"<script language=javascript type=text/javascript>alert('保存成功');window.location.replace('~/Modify.aspx')</script>"
Response.write(script);

我姓区不姓区 2009-04-15
  • 打赏
  • 举报
回复

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

62,268

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧