父类页面

<html>
<head>

    <script type="text/javascript">
            function GetData(data)
            {
                alert(data);
                document.getElementById("id1").value=data;
            }
    </script>

</head>
<body>
    <div>
        <input id="id1" type="text" value="11" />
    </div>
    <div>
        <iframe id="frameid" src="b.aspx"></iframe>
    </div>
</body>
</html>

子类页面

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>

    <script type="text/javascript">
    function OnTest()
    {
        var data=document.getElementById("test").value;
        parent.GetData(data);
    }
    </script>

    <div>
        <input id="test" type="text" value="将此值传到主页面控件中" />
        <button onclick="OnTest()">
            test</button>
    </div>
</body>
</html>

posted on 2015-04-27 16:21  屠龙尊者  阅读(542)  评论(0编辑  收藏  举报