主页面 var k = window.showModalDialog("test.html",window,"dialogWidth:335px;status:no;dialogHeight:300px"); test页面 var s = document.getElementById("???").value; window.returnValue=s; window.close();
在a页面中将textbox输入框(帐号)id传到模态窗体b中 var txtname = document.getElementById('<%=TextBox.ClientID%>'); window.showModalDialog("b.aspx?id="+txtname.id+"&"+Math.random(),window,"dialogTop:100px;dialogLeft:200px;dialogWidth:530px;dialogHeight:450px"); 在b中 //获得父窗体传过来的参数 var tbid='<%=Request.QueryString["id"]%>'; var e=window.dialogArguments; e.document.all(tbid).value=gridview选中的;
http://www.why100000.com/_articles/show_a_article.asp?tab=tabAspNet&autoid=128如果是 ASP.NET2.0,我也可以告诉你.
可以做到,在B中选择到数据后,直接使用脚本刷新A的控件
给你个思路,网是不少这个资料的
做项目中..............头好痛..............
Request.Querystring
两种简单传值方法
<a href='a.aspx?id=''>B数据</a>
将该列数据ID传到A页面
在A页面查询数据 将查询到的数据附给控件
var k = window.showModalDialog("test.html",window,"dialogWidth:335px;status:no;dialogHeight:300px");
test页面
var s = document.getElementById("???").value;
window.returnValue=s;
window.close();
var txtname = document.getElementById('<%=TextBox.ClientID%>');
window.showModalDialog("b.aspx?id="+txtname.id+"&"+Math.random(),window,"dialogTop:100px;dialogLeft:200px;dialogWidth:530px;dialogHeight:450px");
在b中
//获得父窗体传过来的参数
var tbid='<%=Request.QueryString["id"]%>';
var e=window.dialogArguments;
e.document.all(tbid).value=gridview选中的;
{
info = info.Replace("\n","");
//string scriptClientId=string.Empty;
string strscript="<script language='javascript'>";
strscript += "alert('"+ info +"');";
strscript += "window.parent.returnValue=" + retVal + ";";
strscript += "window.close();";
strscript += "</script>";
if(!mypage.IsStartupScriptRegistered("ShowMsg"))
mypage.RegisterStartupScript("ShowMsg", strscript);}这个是模态窗口里面保存按钮或者取消按钮调用的。public static void popUpWindow(System.Web.UI.Page mypage,string YesURL,int Width,int Height)
{
string windowAttribs;
windowAttribs = "dialogHeight: "+Height.ToString()+"px; dialogWidth: "+Width.ToString()+"px;edge: Raised; center: Yes; help: No; resizable: No; status: No; scroll:No;";
string strscript="<script language='javascript'>\n";
strscript += "window.showModalDialog('"+YesURL+"','','"+windowAttribs+"');\n";
strscript += "</script>";
if(!mypage.IsStartupScriptRegistered("ConfirmMsg"))
mypage.RegisterStartupScript("ConfirmMsg", strscript);
}
这个是副窗体中某个按钮点击后产生的,这些东东你都可以直接写js来实现,不过我这样做也可以,具体细节可以讨论
二、request.form["Stringvalue"]
三、session对象
四、Server.Transfer及response.redirect("*.aspx?id=<%=Container.....%>")
五、Querystring对象等
服务端传就用Session