locked
Close ModalPopup From frame(another page) RRS feed

  • Question

  • User-2063862120 posted

    hello, m showing another page (i.e Default2.aspx) for modalpoup . Default2.aspx has gridview.

    By clicking on 'Select ' linkbutton in Gridview,i want to close the popup window

    How to close it....Please help

    FirstPage.aspx-->

    <cc1:ModalPopupExtender ID="mp1" runat="server" PopupControlID="Panl1" TargetControlID="Button1"
    CancelControlID="Button2" BackgroundCssClass="Background" BehaviorID="mpeBehavior">
    </cc1:ModalPopupExtender>
    <asp:Panel ID="Panl1" runat="server" CssClass="Popup" align="center" style = "display:none">
    <iframe style=" width: 350px; height: 300px;" id="irm1" src="Default2.aspx" runat="server"></iframe>
    <br/>
    <asp:Button ID="Button2" runat="server" Text="Close" />

    -------------------------------------------------------------------------------------------------------------------

    Default2.aspx-->

    <asp:GridView ID="grvDemo" runat="server" onrowcommand="grvDemo_RowCommand">
    <Columns>
    <asp:TemplateField>
    <ItemTemplate>

    <asp:LinkButton ID="lnkSelect" runat="server" Text="Select" CommandName = "Select" OnClientClick = "return GetSelectedRow(this)" />
    </ItemTemplate>
    </asp:TemplateField>
    </Columns>
    </asp:GridView>

    Friday, September 26, 2014 4:07 AM

Answers

  • User1918509225 posted

    Hi rupa.patil16,

    You need to use BehaviorID in javascript to find the ModalPopupExtender  control,then  try  SumoS' suggestion:

    function HidePopup() {
    $find( '#mpeBehavior' ).hide();
    }

    Best Regards,

    Kevin Shen.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 28, 2014 4:39 AM

All replies

  • User2115914008 posted

    Hi,

    Have this javascript function in FirstPage.aspx,

    function HidePopup() {
    $find( '#mp1' ).hide();
    }


    Default2.aspx-->

    lnkSelect - OnClientClick event call like this, 

    parent.HidePopup();

     

    Friday, September 26, 2014 5:19 AM
  • User1918509225 posted

    Hi rupa.patil16,

    You need to use BehaviorID in javascript to find the ModalPopupExtender  control,then  try  SumoS' suggestion:

    function HidePopup() {
    $find( '#mpeBehavior' ).hide();
    }

    Best Regards,

    Kevin Shen.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 28, 2014 4:39 AM