Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Close iframe from another page in code behind

$
0
0

I have an a web application which have a button that will open an iframe form windows.

open.aspx is the button click

supervisor.aspx is the page open using iframe

if the supervisor is true, how can I automatically closed the iframe? for now I use a button click to close and I want to avoid less clicking.


Thanks in advance

//the open.aspx

<div style="vertical-align: middle; text-align: center; left: 500px; width: 122px; position: absolute; top: 560px; height: 50px; z-index: 126; right: 889px; font-size: 50pt; font-family: Calibri; font-weight: bold;" id="uncheckbutton"><asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:Button ID="Button1" runat="server" Text="UNCHECK" /> //this is the onclick button to open the iframe<cc1:ModalPopupExtender ID="mp1" runat="server" PopupControlID="Panl1" TargetControlID="Button1" CancelControlID="Button2" BackgroundCssClass="Background"> </cc1:ModalPopupExtender> <asp:Panel ID="Panl1" runat="server" CssClass="Popup" align="center" style = "display:none"> <iframe style=" width:400px; height: 150px;" id="irm1" src="Uncheck popup.aspx" runat="server"> </iframe> <asp:button Top="100px" id="button2" runat="server" text="CLOSE" />




//and this is the supervisor.aspx(the iframe)

<asp:TextBox ID="inputid" runat="server" Font-Size="14px" ></asp:TextBox> <asp:Button ID="Button3" runat="server" Text="Uncheck" OnClick="btnCheck_Click" />
if the user enter the correct username, i want the iframe to automatically close.


//this is my supervisor.aspx.cs


protected void btnCheck_Click(object sender,EventArgs e) { string uncheck = inputid.Text; bool supervisor = Cls.GetUncheckSupervisor(uncheck); if (supervisor==true) { this.ClientScript.RegisterClientScriptBlock(this.GetType(), "Close", "window.close()", .true); } else { Show("Wrong ID!"); }

Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>