开发者

How to disable an AJAX PopupExtender from another PopupExtender?

I m using a ModalPopupExtender1 in my page to edit some information this is a panel that I m using contain some textbox and a link to upload photo when this link is clicked a new ModalPopupExtender2 is open to upload file When I open my 1st pop extender I m 开发者_Python百科able to disable page using this script

.modalBackground 
    {
        background-color:Black;
        filter:alpha(opacity=70);
        opacity:0.7; 
    }

I m unable to disable my 1st Popupextender using the same code What I want is to disable my 1st popupextender when my 2nd popupextender is open


What I do with the ModalPopupExtender is wrap it in a panel and updatepanel:

<asp:Button ID="btnShowPopup" runat="server" style="display:none" />
<asp:ModalPopupExtender ID="mdlPopup" runat="server" TargetControlID="btnShowPopup" PopupControlID="upModal" BackgroundCssClass="modalBackground" />

<asp:Panel ID="pModal" runat="server" width="450px">
    <asp:UpdatePanel ID="upModal" runat="server" UpdateMode="Conditional">
       <ContentTemplate>
       MODAL CONTENTS HERE
       </ContentTemplate>
    </asp:UpdatePanel>
</asp:Panel>

I can then call the .Show() and .Hide() methods of the modals and the update panels. You should be able to do something like this on your edit information modal:

Protected Sub btnUploadFile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUploadFile.Click
   mdlEditInfo.Hide()
   mdlUploadFile.Show()
End Sub

You can then switch back and forth between the modals, and update them if needed through the UpdatePanel.

 Protected Sub btnUploadDone_Click(ByVal sender as Object, ByVal e As System.EventArgs) Handles btnUploadDone.Click
   lblStatus.Text = "File uploaded successfully" 'control in the UpdatePanel for the EditInfo modal
   upEditInfo.Update()

   mdlUploadFile.Hide()
   mdlEditInfo.Show()
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜