一个页面传值问题

hl362496158 2010-09-14 12:45:44
我在一个页面 打开另一个子页面,在子页面上选取一个值,关闭的时候父页面的文本框已经显示了这个值,但在后台却调用不到,venname.text的值为“”,venname 是父页面文本框的id,是用aspx页面,
function GetSupplierList(temp) {
if (temp != "") {
temp = temp.split(",")
document.getElementById("ctl00_ContentPlaceHolder1_hfdSupplier").value = temp[0];
document.getElementById("ctl00_ContentPlaceHolder1_Supplier").value = temp[1];
alert(temp[1]);

}
}
这是我的父页面的方法,

function getCheck() {
t1 = "rpt1_ctl";
t2 = "_cboCode";
t3="";
var strRess = "";
for (i = 0; i < $("input[@type=checkbox]").length; i++) {
if ($("input[@type=checkbox]")[i].id.indexOf(t1) > -1 || $("input[@type=checkbox]")[i].id.indexOf(t2) > -1) {
if ($("input[@type=checkbox]")[i].checked == true) {
var tid = $("input[@type=checkbox]")[i].id;
//ctl00_ContentPlaceHolder1_rpt1_ctl05_Label2
// if(i.toString().length==1)
// {
t3 = "ctl00_ContentPlaceHolder1_ListView2_ctrl" + i + "_Label2";
// }
// else
// {
// t3="ctl00_ContentPlaceHolder1_rpt1_ctl"+i+"_Label2";
// }
strRess = $("label[@for=" + tid + "]").html()+","+document.getElementById(t3).innerHTML;
window.opener.GetSupplierList(strRess);
self.close();
}
}
}
}
这是子页面的方法
...全文
229 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
beyond_me21 2010-09-14
  • 打赏
  • 举报
回复
后台用request["name"]来取值
litaoso 2010-09-14
  • 打赏
  • 举报
回复
...星哥,您那个值是在表单里边的么?
...如果是在表单里边提交的时候method是不是post?
...应该是没得到..
hl362496158 2010-09-14
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 wuyq11 的回复:]
window.open打开页面
ChildWindow = window.open ('a.aspx?a=<%=TextBox1.ClientID%>','','width=200,height=200,left=250,top=100,menubar=no,toolbars=no,location=no,directories=no,scrollbar=no,status=no,resizab……
[/Quote]
据说是要用隐藏的表单 接收请问知道怎么弄么?
wuyq11 2010-09-14
  • 打赏
  • 举报
回复
window.open打开页面
ChildWindow = window.open ('a.aspx?a=<%=TextBox1.ClientID%>','','width=200,height=200,left=250,top=100,menubar=no,toolbars=no,location=no,directories=no,scrollbar=no,status=no,resizable=no');
var txtID = "<%=Request.QueryString["a"]%>";
window.opener.document.getElementById(txtID).value=""
或showmodaldialog传值
venname?
gongsun 2010-09-14
  • 打赏
  • 举报
回复
不会吧,星爷。

你给 venname.text 赋值了,后台会取不到???

62,271

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧