Dkong
Dkong

Reputation: 2788

Redirect parent window from iFrame

I have an asp.net page inside an iFrame. I want to redirect the parent page (that sits outside the iFrame) when an asp.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

Upvotes: 1

Views: 2469

Answers (1)

kishan thakur
kishan thakur

Reputation: 21

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"/>

Upvotes: 2

Related Questions