两个iframe的传值问题

softstore 2004-04-02 12:57:58
我有一个html页面
里面有两个iFrame
我想实现在左边的leftframe(left.aspx)
中让用户输入查询条件,而rightfram(right.aspx)中显示结果
right.aspx中有个datagrid,


这是left.asp的javascript的代码
<script language="javascript">
function LToR()
{

//alert("left is submit");

window.parent.frames.item('rightF').location.href="right.aspx?name="+document.Form1.all["TextBox1"].value;
//页面刷新,但是不能提交到服务器,服务器控件都不显示啦,好象部能保持状态

//window.Form1.action="right.aspx?name=aa";
//window.Form1.target="rightF";
//window.Form1.submit();

}

请高手解答!
...全文
86 10 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
softstore 2004-04-02
  • 打赏
  • 举报
回复
高手指点一下!!!!
高手指点一下!!!!
高手指点一下!!!!
高手指点一下!!!!
高手指点一下!!!!
奇怪,我传参数如果是三个字另外一个页面只能取两个字
如果参数是单数,只能得到双数(汉字有这个现象)
比如传"持方的",得到只能是“持方”


string strScript="<script>window.open('employee.aspx?name="+TextBox1.Text.ToString()+"','rightF')</script>";


selectStr="select * from T_Employee where name='"+Request.QueryString["name"].ToString()+ "'" ;
}
softstore 2004-04-02
  • 打赏
  • 举报
回复
奇怪,我传参数如果是三个字另外一个页面只能取两个字
如果参数是单数,只能得到双数(汉字有这个现象)
比如传"持方的",得到只能是“持方”


string strScript="<script>window.open('employee.aspx?name="+TextBox1.Text.ToString()+"','rightF')</script>";


selectStr="select * from T_Employee where name='"+Request.QueryString["name"].ToString()+ "'" ;
}
softstore 2004-04-02
  • 打赏
  • 举报
回复
奇怪,我传参数如果是三个字另外一个页面只能取两个字
如果参数是单数,只能得到双数(汉字有这个现象)
比如传"持方的",得到只能是“持方”


string strScript="<script>window.open('employee.aspx?name="+TextBox1.Text.ToString()+"','rightF')</script>";


selectStr="select * from T_Employee where name='"+Request.QueryString["name"].ToString()+ "'" ;
}
常修溢 2004-04-02
  • 打赏
  • 举报
回复
向五颗星学习。在布局中设定左右的名称。
qynum123()
Response.Write("<Script>window.parent.frames['rightF'].location.href='right.aspx?name='+document.all['TextBox1'].value</" + "script>")的方法可以。
softstore 2004-04-02
  • 打赏
  • 举报
回复
奇怪,我传参数如果是三个字另外一个页面只能取两个字
如果参数是单数,只能得到双数(汉字有这个现象)
比如传"持方的",得到只能是“持方”


string strScript="<script>window.open('employee.aspx?name="+TextBox1.Text.ToString()+"','rightF')</script>";


selectStr="select * from T_Employee where name='"+Request.QueryString["name"].ToString()+ "'" ;
}
qynum123 2004-04-02
  • 打赏
  • 举报
回复
在左边点击的事件中填加:
Response.Write("<Script>window.parent.frames['rightF'].location.href='right.aspx?name='+document.all['TextBox1'].value</" + "script>")
组合缺一 2004-04-02
  • 打赏
  • 举报
回复
window.parent.frames['rightF'].document.控件ID.value="值";
试试。或许可以。
reaperwu 2004-04-02
  • 打赏
  • 举报
回复
left.aspx
string Url = "AdvancedSearchResult.aspx?";
Url += "StaffStatusID=" + rblStaffStatus.SelectedValue.Trim();
Url += "&PostTitleID=" + ddlPostTitle.SelectedValue.Trim();
Page.RegisterStartupScript("", "<script language='javascript'>showModalDialog('"+ Url +"',null,'dialogHeight:700px;dialogWidth:900px;scroll:no;status=no');</script>");

right.aspx
Request["StaffStatusID"]
Request["PostTitleID"]
孟子E章 2004-04-02
  • 打赏
  • 举报
回复
你的方法也是可以的
window.parent.frames['rightF'].location.href="right.aspx?name="+document.all["TextBox1"].value;
孟子E章 2004-04-02
  • 打赏
  • 举报
回复
你可以提交到左边,处理后进行
Response.Write("<script>window.open('xxx.aspx?name=xxx','rightIframeName')</script>")

62,243

社区成员

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

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

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

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