Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
The following is my code for displaying Pop Up in my Page.
Here when i am clicking on the Button it is not displaying Pop Up...So Please help me...

XML
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

      <asp:Button ID="Button1" runat="server" Text="Click here to show the modal" />
            <cc1:ModalPopupExtender ID="ModalPopupExtender1" BackgroundCssClass="ModalPopupBG"
                   runat="server" CancelControlID="btnCancel" OkControlID="btnOkay" TargetControlID="Button1"
                  PopupControlID="Panel1" Drag="true" PopupDragHandleControlID="PopupHeader">


            <div id="Panel1" style="display: none;" class="popupConfirmation">
                  <div class="popup_Container">
                        <div class="popup_Titlebar" id="PopupHeader">
                              <div class="TitlebarLeft">Popup Header</div>
                              <div class="TitlebarRight"></div>
                        </div>
                        <div class="popup_Body">
                              <p>
                                    This is a simple modal dialog
                              </p>
                        </div>
                        <div class="popup_Buttons">
                              <input id="btnOkay" value="Done" type="button" />
                              <input id="btnCancel" value="Cancel" type="button" />
                        </div>
                  </div>
            </div>
Posted
Updated 28-Feb-13 23:59pm
v2

Hi Balakrishna

It was not working. B'cos you didn't close the modalpopupextender tag
I have just closed the tag and executed, It is workin.

Below is the modified code:

XML
<cc1:modalpopupextender id="ModalPopupExtender1" backgroundcssclass="ModalPopupBG"
        runat="server" cancelcontrolid="btnCancel" okcontrolid="btnOkay" targetcontrolid="Button1"
        popupcontrolid="Panel1" drag="true" popupdraghandlecontrolid="PopupHeader"></cc1:modalpopupextender>


            <div id="Panel1" style="display: none;" class="popupConfirmation">
                  <div class="popup_Container">
                        <div class="popup_Titlebar" id="PopupHeader">
                              <div class="TitlebarLeft">Popup Header</div>
                              <div class="TitlebarRight"></div>
                        </div>
                        <div class="popup_Body">
                              <p>
                                    This is a simple modal dialog
                              </p>
                        </div>
                        <div class="popup_Buttons">
                              <input id="btnOkay" value="Done" type="button" />
                              <input id="btnCancel" value="Cancel" type="button" />
                        </div>
                  </div>
            </div>
 
Share this answer
 
v2
Comments
Balakrishna2 1-Mar-13 6:51am    
Thanks for your response.it is not working for me..the following is my entire code..please Help me...



<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

<asp:UpdatePanel ID="update" runat="server">
<contenttemplate>

<asp:Button ID="Button1" runat="server" Text="Click here to show the modal" />
<cc1:modalpopupextender id="ModalPopupExtender1" backgroundcssclass="ModalPopupBG"
runat="server" cancelcontrolid="btnCancel" okcontrolid="btnOkay" targetcontrolid="Button1"
popupcontrolid="Panel1" drag="true" popupdraghandlecontrolid="PopupHeader">



<div id="Panel1" style="display: none;" class="popupConfirmation">
<div class="popup_Container">
<div class="popup_Titlebar" id="PopupHeader">
<div class="TitlebarLeft">Popup Header</div>
<div class="TitlebarRight"></div>
</div>
<div class="popup_Body">
<p>
This is a simple modal dialog
</p>
</div>
<div class="popup_Buttons">
<input id="btnOkay" value="Done" type="button" />
<input id="btnCancel" value="Cancel" type="button" />
</div>
</div>
</div>





Thanks in Advance..
XML
<asp:UpdatePanel ID="update" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Button ID="Button1" runat="server" Text="Click here to show the modal" />
            <cc1:ModalPopupExtender ID="ModalPopupExtender1" BackgroundCssClass="ModalPopupBG"
                runat="server" CancelControlID="btnCancel" OkControlID="btnOkay" TargetControlID="Button1"
                PopupControlID="Panel1" Drag="true" PopupDragHandleControlID="PopupHeader">
            </cc1:ModalPopupExtender>
            <div id="Panel1" style="display: none;" class="popupConfirmation">
                <div class="popup_Container">
                    <div class="popup_Titlebar" id="PopupHeader">
                        <div class="TitlebarLeft">
                            Popup Header</div>
                        <div class="TitlebarRight">
                        </div>
                    </div>
                    <div class="popup_Body">
                        <p>
                            This is a simple modal dialog
                        </p>
                    </div>
                    <div class="popup_Buttons">
                        <input id="btnOkay" value="Done" type="button" />
                        <input id="btnCancel" value="Cancel" type="button" />
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900