现在有这样一个需求,在一个页面有一个button和一个GridView,我需要点击button时打开另一个页面,在页面上添加一些信息,然后点击确定,这时要关闭后来打开的页面并刷新第一个页面,请问我需要怎么做~~~~~~~
希望大家帮我一下,谢谢了~~~~~~
希望大家帮我一下,谢谢了~~~~~~
解决方案 »
- 求大神帮助,关于JS在服务器端运行的问题。
- 请求JQuery和JQuery-ui所有JS文件的解释
- 关于sql server中连接的状态问题,一直都是睡眠状态。
- 帮看看这个存储过程问题出在什么地方,老提示:当没有用 EXISTS 引入子查询时,在选择列表中只能指定一个表达式
- 大家帮我看看DataGrid中的LinkButton怎么显示不出来啊
- 各位大哥,帮帮小妹!!!关于两个数据库之间的连接问题!
- 静态方法如何实现文件下载?
- 在asp.ent中怎么使用extjs?
- Update 数据库的问题!!来者有分,有点急!
- 高手请进,急,急,急!!!!!!!!!!
- C#基础疑问?
- 请大伙来看看我的SQL语句问题!顶这有分!不够+++!SOS
or
opener.window.document.location.href=opener.window.document.location.href;
string script="<script language='javascript'>window.showModalDialog('b.aspx');window.location.replace('a.aspx');</script>";if (!ClientScript.IsStartupScriptRegistered("showModal"))
{
ClientScript.RegisterStartupScript(this.GetType(), "showModal", script);
}
this.btnAdd.Attributes.Add("onclick", "return Add()");
前台:function Add()
{
var strUrl = "Edit.aspx?&sno=" + sno;//所传递参数
var ret = window.showModalDialog(strUrl,'',"dialogWidth=350px;dialogHeight=200px;center=1;scroll=0");
if(ret == null)
{
return false;
}
}
再在protected void Button_Click(object sender, EventArgs e)
{ }
里重新绑定数据
在新页面的“确定”
protected void Button_Click(object sender, EventArgs e)
{
Response.Write("<script language=javascript>window.returnValue=true; window.close();</script>");
}
大致就是这样了
还有一种方法,就是reload,如果需要再说明
Response.Write("<script>opener.window.document.location.href=opener.window.document.location.href;opener=null;window.close();</script>");
最好中间用一个框加页过渡一下,不然关掉新页后有会自动打开,关不掉新页;
过渡页html代码如:
<HTML>
<HEAD>
<TITLE>commonPage</TITLE>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<frameset rows="0,*">
<frame src="about:blank">
<frame src="新页">
</frameset>
</HTML>