在iframepage中访问父页面的QueryString [英] Access QueryString of parent page, in iframepage

查看:143
本文介绍了在iframepage中访问父页面的QueryString的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个搜索页面,我的页面网址"为("search.aspx?id1 = 8"),
我在此页面中使用iFrame,
所以我的问题是,我无法在iframe页面中访问此id1查询字符串,

我在IFrame页面中尝试使用此方法:Int32 id1 = Convert.ToInt32(Request.QueryString ["id1"]);

I have a search page, and My Page Url is ("search.aspx?id1=8"),
And I Use iFrame in This Page,
So my problem is, i am not able to access this id1 querystring in Iframe Page,

I Try This in IFrame Page: Int32 id1 = Convert.ToInt32(Request.QueryString["id1"]);

推荐答案

您可以获取父页面的查询字符串在iframe页面上使用javascript.
请点击链接以供参考
http://stackoverflow.com/questions/7962646/how-要从一个父代pag中获取查询字符串 [
You can get the querystring of the parent page using javascript on your iframe page .
Please chk the link for your reference
http://stackoverflow.com/questions/7962646/how-to-get-the-querystring-from-a-parent-pag[^]


方法之一是..您可以在页面加载时调用此函数,从此函数获取值并将该值存储在输入类型=隐藏变量中.
您可以在代码中的任何位置访问此隐藏变量.
one of the method is .. you can call this function on page load & get value from this function & store that value in a input type=hidden variable .
You can access this hidden variable anywhere in your code.


找到了解决方案:

在iframe的源中调用页面时,我可以传递参数...

Found the solution:

I could pass the parameter when calling the page in the source of the iframe...


这篇关于在iframepage中访问父页面的QueryString的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆