views:

904

answers:

1

hi i have 2 panel and and using ajax modalpopup control

                        <asp:Panel ID="pnlHeadWD" runat="server" CssClass="modalPopupWD" 
                            BackImageUrl="~/WebSiteContent/Images/Cloud.JPG">
                            <asp:Panel ID="pnlBodyWD" runat="server">
                                <div id="Div1" style="position: absolute; left: 15%; top: 15%; vertical-align: middle;">
                                    <br />
                                    <br />
                                    <br />
                                    <br />
                                    <br />
                                    <p>
                                        <asp:PlaceHolder ID="phcontrolWD" runat="server"></asp:PlaceHolder>
                                    </p>
                                    <div>
                                        <center>
                                            <asp:ImageButton ID="imgbtnOkWD" runat="server" Visible="false" OnClientClick="$find('pnlHeadWD').hide(); return false;" />
                                        </center>
                                    </div>
                                </div>
                            </asp:Panel>
                        </asp:Panel>

                        <asp:TextBox ID="txtHidden" Visible="false" runat="server"></asp:TextBox>
                        <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="lblCopyright"
                            PopupControlID="pnlHead" BackgroundCssClass="modalBackground" DropShadow="true"
                            PopupDragHandleControlID="pnlBody">
                        </cc1:ModalPopupExtender>

                        <cc1:ModalPopupExtender ID="ModalPopupExtender2" runat="server" TargetControlID="lblCopyright"
                            BehaviorID="pnlHeadWD" PopupControlID="pnlHeadWD" BackgroundCssClass="modalBackground"
                            DropShadow="true" PopupDragHandleControlID="pnlBodyWD">
                        </cc1:ModalPopupExtender>

when i tried to call the first " ModalPopupExtender1" then even the second " ModalPopupExtender2" is getting executing and 2 modal popup extebder a re shown public void Populate_Popup(String URL,String Message_Identifier) { this.ModalPopupExtender1.Show(); }

public void Populate_Popup2(string Message) { this.ModalPopupExtender2.Show(); }

A: 

your TargetControlID="lblCopyright" for both ModalPopupExtender is same.

Muhammad Akhtar
1: yes for both ModalPopupExtender controls i have the same TargetControlID="lblCopyright". <cc1:ModalPopupExtender ID="ModalPopupExtender2" runat="server" TargetControlID="Label1" PopupControlID="pnlHeadWD" BackgroundCssClass="modalBackground" DropShadow="true" PopupDragHandleControlID="pnlBodyWD"> </cc1:ModalPopupExtender> code has been changed in this way 2: TargetControlID="Label1" is changed for the even then not working
prince23
thank's for ur replay Muhammad Akhtarnow i have changed the target control id for ModalPopupExtender2. but now ia m getting an error telling error:Sys.InvalidOperationException: Two components with the same id 'ctl00_ModalPopupExtender2' can't be added to the application.i am getting this error thank you
prince23