.net won't start with ajax toolkit. Targetcontrolid property for ModalPopupExtender

I want to trigger a .net button event via ajax toolkit modalpopupextender targetcontrolid property

Here is my code

<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" 
TargetControlID="Button2" CancelControlID = "Button3" 
PopupControlID="pnlPromptConfirmConsignorMaster" BackgroundCssClass="modalBackground">
        </ajaxToolkit:ModalPopupExtender>

<asp:Panel ID="pnlPromptConfirmConsignorMaster" runat="server" BackColor="White" Height="200px" Width="450px" Style="vertical-align: middle">
    <table width="100%" style="height: 100px; z-index: 99999" cellpadding="20" cellspacing="10" id="Table5" runat="server">
         <tr style="background-color: Purple">
             <td>
                 <table style="width: 100%">
                    <tr>
                        <td style="width: 150px;" colspan="3">
                            <h2 style="color: Yellow;">
                                Master Confirmation Required ...!!!
                            </h2>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 150px; color: White; font-weight: bold;" colspan="3">
                            <table style="width: 100%">
                                <tr>
                                    <td>
                                        <img src="../Resources/ico_deleted_success2.GIF" height="80" width="80" id="img5"
                                            runat="server" />
                                    </td>
                                    <td>
                                        Want To Create Consignor Master...???
                                        <asp:Label ID="Label8" runat="server" ReadOnly="true" Width="80px"
                                            CssClass="txtRightAlign"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr style="background-color: White;">
            <td>
            <asp:Button ID="Button2" runat="server" Text="Confirm" CausesValidation="false"
                    OnClick="Button2_Click" BackColor="Black" ForeColor="White" BorderStyle="None"
                    Height="30" Width="100" />

                <asp:Button ID="Button3" runat="server" Text="Cancel" CausesValidation="false"
                    BackColor="Black" ForeColor="White" BorderStyle="None" Height="30" Width="100" />
            </td>
        </tr>
    </table>
</asp:Panel>

      

Here you can see that I took one ajax modalpopupextender in that I call a .net button event named button2 via ajax modalpopupextender on the TargetControlID property. But I don't know how this event is not fired.

Here is the .net button event I created

 protected void Button2_Click(object sender, EventArgs e)
    {
      //Here is my code
    }

      

ThankYou.

+3


source to share


1 answer


You want to add another button that includes = "false" and specify that button ID for the ajax control. This exit.



+1


source







All Articles