.net按钮事件不是通过ajax toolkit ModalPopupExtender targetcontrolid属性触发的

时间:2021-12-14 00:09:48

I want to call the .net button event through ajax toolkit modalpopupextender targetcontrolid property

我想通过ajax toolkit modalpopupextender targetcontrolid属性调用。net按钮事件

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 have taken one ajax modalpopupextender in that I am calling .net button event named button2 through ajax modalpopupextender by TargetControlID property. But I dont know that how this event is not fired.

在这里,您可以看到,我已经使用了一个ajax modalpopupextender,我正在通过TargetControlID属性,通过ajax modalpopupextender调用。net按钮事件,命名为button2。但我不知道这件事是怎么发生的。

Here is the .net button event I created

这是我创建的。net按钮事件

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

ThankYou.

谢谢。

1 个解决方案

#1


1  

You want to add one more button which is enable = "false" and give that button id to the ajax targetcontrolid. That's exit.

您还需要添加一个名为enable = "false"的按钮,并将该按钮id赋予ajax targetcontrolid。这是出口。

#1


1  

You want to add one more button which is enable = "false" and give that button id to the ajax targetcontrolid. That's exit.

您还需要添加一个名为enable = "false"的按钮,并将该按钮id赋予ajax targetcontrolid。这是出口。