if (r.IsSuccessed)
{
Response.Write("<script>alert('" + "成功保存!" + "');</script>"); //---这里没作用??
Response.Redirect("Ad_RolesList.aspx");
}
else
{
Response.Write("<script>alert('" + r.Error + "');</script>");
return;
}
---------------------------------------------------------------
为什么成功保存没有弹出来?如何做?
{
Response.Write("<script>alert('" + "成功保存!" + "');</script>"); //---这里没作用??
Response.Redirect("Ad_RolesList.aspx");
}
else
{
Response.Write("<script>alert('" + r.Error + "');</script>");
return;
}
---------------------------------------------------------------
为什么成功保存没有弹出来?如何做?
解决方案 »
- 窗体加载时报未能加载文件或程序集XX.dll
- wpf里面treeview数据绑定
- C#如何实现DLL方面的综合编程
- 如何将自己写的图片浏览器设为默认图片浏览器
- 怎样得到WebResponse.ContentLength=-1的网页的大小?
- C#连接access数据库进行用户名密码验证,菜鸟求救,各位大侠看看小弟哪个地方错了,万分感谢
- C# 读取CSV数据到DataSet的问题
- 一道程序问题解答?
- c#.net动态加载用户控件问题
- 再问 C#中怎样使 Web窗体控件的TextBox控件在输入完内容时按回车跳至一个焦点?
- wince下textbox用lostfocus的问题
- 怎么把数据库里的html语言通过编译后显示出来
Response.Redirect("Ad_RolesList.aspx"); //但是页面A还没有传到客户端的时候,你就转到新的页面去了,当然没有提示没有特殊要求的话
Response.Write(" <script>alert('" + "成功保存!" + "');Location.href='Ad_RolesList.aspx'; </script>");
<!--
var duration=2900;
var endTime = new Date().getTime() + duration + 100;
function interval()
{
var n=(endTime-new Date().getTime())/1000;
if(n<0) return;
document.getElementById("timeout").innerHTML = n.toFixed(3);
setTimeout(interval, 10);
}
window.onload=function()
{
setTimeout("window.location.href='http://community.csdn.net/homepage.aspx'", duration);
interval();
}
//-->
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
发生错误
</title></head>
<body>
<form name="form1" method="post" action="err.aspx?404%3bhttp%3a%2f%2ftopic.csdn.net%3a80%2fu%2f20090903%2f16%2f9aef6ed7-7996-470f-a08c-68d7a5b5d9d2.html" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNzgzNDMwNTMzZGTBJ75uFTxvajO9N2YxgXjDXYyDqg==" />
</div> <div>
对不起!你所访问的页面出错!<br />
系统在 <span id="timeout">3.000</span> 秒后 将自动跳转到 <a href="http://community.csdn.net/homepage.aspx">社区首页</a>
</div>
</form>
不起作用是因为下一句
Response.Redirect("Ad_RolesList.aspx");
这句使客户端没执行alert,就跳到新的网页文件。
可用
<script>
alert('" + "成功保存!" + "');
Location.href='Ad_RolesList.aspx';
</script>";
Response.Redirect("Ad_RolesList.aspx"); 可以改为
Response.Write(" <script>alert('" + "成功保存!" + "');window.location = 'Ad_RolesList.aspx'; </script>");