日期:2014-05-18  浏览次数:20388 次

一个页面a.aspx的textbox输入框(帐号)的数据需要从另一个页面b.aspx获得,该怎么做呢?
一个页面a.aspx的textbox输入框(帐号)的数据需要从另一个页面b.aspx获得,该怎么做呢?

b.aspx里面是一个gridview,可以列表出所有帐号的数据,该怎么做?

好象是用什么模式窗口打开,然后返回是么,具体该怎么样做啊

------解决方案--------------------
ASP.NET 1.0/1.1 页面间的传值的几种方法:
http://www.why100000.com/_articles/show_a_article.asp?tab=tabAspNet&autoid=128

如果是 ASP.NET2.0,我也可以告诉你.
------解决方案--------------------
javascript
可以做到,在B中选择到数据后,直接使用脚本刷新A的控件
给你个思路,网是不少这个资料的
------解决方案--------------------
好象是用什么模式窗口打开,然后返回是么,具体该怎么样做啊

JS

showModelessDialog方法

自己上网搜下例子吧

------------------------
做项目中..............头好痛..............
------解决方案--------------------
session
Request.Querystring
两种简单传值方法

------解决方案--------------------
在数据里绑定连接到A
<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();

------解决方案--------------------
在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选中的;

------解决方案--------------------
用页面传值,方法很多
------解决方案--------------------
public static void showmessageRet(System.Web.UI.Page mypage,string info,string retVal)
{
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 "))