日期:2014-05-17  浏览次数:20340 次

【求助】关于Asp.net页面间传递参数的问题
本帖最后由 liuyunzhi82 于 2013-06-26 17:48:53 编辑
我有一个纯html页面index.htm在里面嵌套了一个ifram

<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>                                                       
              <td>
                  <iframe src="http://localhost:2690/UserLoginForCms.aspx" width="230"                  frameborder="0"  scrolling="no">
                  </iframe>
               </td>
          </tr>
 </table>

在index.htm页面中的body中的onload事件加入了
<body style="margin: 0 auto;" onload="displayScreenSize()">

javascript的代码如下

<head>
<script language="javascript">
   function displayScreenSize() {
        document.getElementById("sWidth").value = document.documentElement.clientWidth;
        document.getElementById("sHeight").value = document.documentElement.clientHeight;
    }
</script>
</head>

现在我想做的是将“sWidth”和“sHeight”这两个Hidden的值传给UserLoginForCms.aspx页面,现在我能想到的方法是这样的

 <iframe src="http://localhost:2690/UserLoginForCms.aspx?swidth=sWidth的value值&sHieght=sHeight的value值" width="230" frameborder="0"  scrolling="no">

请问我应该怎么做才能取到那两个控件的value值,并把它们作为问号后面的变量参数呢?
如果还有什么其他简单的方法也请指教一二,屏幕的宽度与高度值我只能在这个母页面取才正常,所以这两个值只能从这个页面传出去。