check_ws.aspx页面里的gridview 的HyperLink1 弹出页面check_a.aspx
string aurl = "javascript:varwin=window.showModalDialog('check_a.aspx?djh={0}',null,'dialogWidth=800px,dialogHeight=900px ');";在check_a.aspx页面进行审核button操作后,自动关闭页面,check_ws.aspx页面没有更新!
怎样才能关闭弹出页面并更新原页面内容??
我在check_a.aspx的button动作protected void bt_bzadd_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
name = Session["ryxm"].ToString();
QhmxModel qhmxmodel = new QhmxModel();
qhmxmodel.djh = this.Lab_number.Text.Trim();
qhmxmodel.ryxm = name.Trim();
qhmxmodel.qhyjbc = this.txt_qhbz.Text.Trim();
QhmxBLL qhmxbll = new QhmxBLL();
qhmxbll.Update_qhyjbc(qhmxmodel);
Response.Write("<script>alert('备注添加成功!')</script>");
Bindqhmx();
HttpContext.Current.Response.Write(" <script> window.opener.location.reload(); </script> ");
Response.Write("<script>window.close();</script>");
}
}
string aurl = "javascript:varwin=window.showModalDialog('check_a.aspx?djh={0}',null,'dialogWidth=800px,dialogHeight=900px ');";在check_a.aspx页面进行审核button操作后,自动关闭页面,check_ws.aspx页面没有更新!
怎样才能关闭弹出页面并更新原页面内容??
我在check_a.aspx的button动作protected void bt_bzadd_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
name = Session["ryxm"].ToString();
QhmxModel qhmxmodel = new QhmxModel();
qhmxmodel.djh = this.Lab_number.Text.Trim();
qhmxmodel.ryxm = name.Trim();
qhmxmodel.qhyjbc = this.txt_qhbz.Text.Trim();
QhmxBLL qhmxbll = new QhmxBLL();
qhmxbll.Update_qhyjbc(qhmxmodel);
Response.Write("<script>alert('备注添加成功!')</script>");
Bindqhmx();
HttpContext.Current.Response.Write(" <script> window.opener.location.reload(); </script> ");
Response.Write("<script>window.close();</script>");
}
}
解决方案 »
- 菜鸟求助..动态修改网页html源码
- 在.net4.0下怎么限制TextBox只能输入数字
- 请教:asp.net 到底能不能获得客户端 MAC?
- 关于“无法获取执行权限"的问题
- 体现一下你的实力,很难解决的一个问题?
- CheckBox的排列方式
- window.parent.uploadCallback('" + path + "');
- 如何在DataGrid外删除数据?都需要什么事件?
- 关于xml保存和读取流的问题
- TextBox内包含html元素时出错,提示检测到有潜在危险的 Request.Form 值,如何解决?
- 使用asp。net前关于win7旗舰下iis网络端口设置
- 各位帮帮忙,是发布网站时发现的错误!!!
后面加一句window.location.href = window.location.href;
string aurl = "javascript:varwin=window.showModalDialog('check_a.aspx?djh={0}',null,'dialogWidth=800px,dialogHeight=900px,window.location.href = window.location.href);');";
这样试试
Response.Write("<script>window.close();</script>");
把第一句删了 第一句已经重新加载当前页面了 后台的代码可能根本没得到执行
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string djh = GridView1.DataKeys[e.Row.RowIndex].Value.ToString();
HyperLink link = (HyperLink)e.Row.FindControl("HyperLink1");
string aurl = "javascript:varwin=window.showModalDialog('check_a.aspx?djh={0}',null,'dialogWidth=800px,dialogHeight=900px,window.location.href = window.location.href ');";
//取列申请书种类的字段值
switch (e.Row.Cells[4].Text)
{
case "申请书":
//link.NavigateUrl = string.Format("check_a.aspx?djh={0}", djh);
link.NavigateUrl = string.Format(aurl, djh);
break;
case "票务证件":
link.NavigateUrl = string.Format("check_b.aspx?djh={0}", djh);
break;
case "住宿": ... break;
}
}
}check_a.aspx 页button事件
protected void bt_bzadd_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
name = Session["ryxm"].ToString();
QhmxModel qhmxmodel = new QhmxModel();
qhmxmodel.djh = this.Lab_number.Text.Trim();
qhmxmodel.ryxm = name.Trim();
qhmxmodel.qhyjbc = this.txt_qhbz.Text.Trim();
QhmxBLL qhmxbll = new QhmxBLL();
qhmxbll.Update_qhyjbc(qhmxmodel);
Response.Write("<script>alert('备注添加成功!')</script>");
Bindqhmx();
Response.Write("<script>window.close();window.parent.opener.location.reload();</script>");
//Response.Write("<script>window.close();</script>");
}
}
谁能帮我改下代码?
我改了后就是不刷新没有更新!!
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题页</title>
<script type="text/javascript">
function sopen(){
var str = window.showModalDialog('Default.aspx',null,'dialogWidth=300px;dialogHeight=300px');
if(str!=null&&str=="yes")
window.location.reload();
}
</script>
</head>
<body>
<a onclick="sopen()">打开</a>
<span id="time"></span>
<script type="text/javascript">
var date = new Date();
document.getElementById("time").innerHTML=date.getMinutes()+"=="+date.getSeconds();
</script>
</body>
</html>
<!--Default.aspx页面-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
</head>
<base target="_self" />
<body style="margin:0px;padding:0px;">
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
</div>
</form>
</body>
</html> protected void Button1_Click(object sender, EventArgs e)
{
Response.Write("<script>window.close();window.returnValue='yes'</script>");
}
在子页面
function reload()
{
window.close();
}加入 <base target="_self"/>
或
window.dialogArguments.window.location = window.dialogArguments.window.location; self.close();session记录页数或传值
也可使用