if的小问题

zhengmushang 2007-04-19 09:56:28
语句如下:
if(button被按下)

{
//执行
Response.Write("<script>alert(\"删除成功!\");</script>");

Response.Redirect("index.aspx");
}

他就直接到了index.aspx页面,没有“删除成功”的提示“。
我想要的是先提示删除成功,在转到index页面,该如何写??
...全文
179 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
sbqcel 2007-04-20
  • 打赏
  • 举报
回复
加在后面不就好了嘛??

Response.Write("<script>alert(\"删除成功!\");location.href='index.aspx?Aname="+Request.QueryString["Aname"]+"';</script>");
zhengmushang 2007-04-19
  • 打赏
  • 举报
回复
谢谢

我需要返回的网址是:
Response.Redirect("index.aspx?Aname="+Request.QueryString["Aname"]);

网址是带有参数Aname的,那么,该如何写下面的这两句呢?
Response.Write("<script>alert(\"删除成功!\");</script>");
Response.Redirect("index.aspx?Aname="+Request.QueryString["Aname"]);
windstore 2007-04-19
  • 打赏
  • 举报
回复
楼上正解。。。
sbqcel 2007-04-19
  • 打赏
  • 举报
回复
Response.Write("<script>alert(\"删除成功!\");</script>");

Response.Redirect("index.aspx");

改为:
Response.Write("<script>alert(\"删除成功!\");location.href='index.aspx';</script>");

//Response.Redirect("index.aspx");

110,537

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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