Modal does not open after using $('.modal-backdrop'). remove()

Asked

Viewed 80 times

-1

I am working with Webform, using Masterpage.

My daughter is inside the Updatepanel, via c# I call opening a modal within another modal, only that each modal opening darkens the background, and when I close the modal until it closes but only the modal the dark curtain keeps behind and does not disappear.

To close this curtain I use $('.modal-backdrop'). remove(), remove the curtain the problem is that it no longer opens the modal.

2 answers

0


It is likely that the modal element is a child of the modal-backdrop element, so when you give the remove() the element and your children are erased from its structure.

It may be more interesting to use . Hide()

0

[Solved]

$('.modal-backdrop'). remove() -- Kills modal html

I solved with the structure below

Master

Page Filha

 <asp:ScriptManager EnablePartialRendering="true"  ID="ScriptManager1" runat="server"></asp:ScriptManager>

 <asp:UpdatePanel ID="UpdatePanel2" runat="server"  >
   <ContentTemplate>
         --- Modal ---
   </ContentTemplate>
 </asp:UpdatePanel>

<Triggers>                                                              
    <asp:AsyncPostBackTrigger ControlID="btnImportarGrade" />
</Triggers>

<Triggers>
    <asp:PostBackTrigger ControlID="imbDownloadTemplate" />
</Triggers>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.