开发者

Redirect parent window from iFrame

开发者 https://www.devze.com 2022-12-31 07:23 出处:网络
I have an asp.net page inside an iFrame. I want to redirect the parent page (that sits outside the iFrame) when an 开发者_如何学Pythonasp.net button on the asp.net page in the iFrame is clicked.

I have an asp.net page inside an iFrame. I want to redirect the parent page (that sits outside the iFrame) when an 开发者_如何学Pythonasp.net button on the asp.net page in the iFrame is clicked.

The asp.net button will need to do some processing before re-directing, so I guess I need to call javascript from the asp.net


just create simple ans: in javascript

<script type="text/javascript">
    function NewWindow() {
        document.forms[0].target = "_top";
    }
</script>

call it any control like button

<asp:LinkButton ID="linkbutton1" Text="Enroll Now" OnClientClick="NewWindow();" runat="server" onclick="enrol_Click"/>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号