2017-06-23 21 views
3

我想打電話給通過Ajax工具包的.NET按鈕事件modalpopupextender的TargetControlID財產.NET按鈕事件不是通過Ajax工具包ModalPopupExtender的TargetControlID財產

這裏解僱是我的代碼

<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> 

在這裏你可以看到我已採取了一個ajax modalpopupextender,我通過TargetControlID屬性通過ajax modalpopupextender調用名爲button2的.net按鈕事件。但我不知道這個事件是如何被解僱的。

這裏是我創建

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

三江源的.NET按鈕事件。

回答

1

您想添加一個enable =「false」的按鈕並將該按鈕ID賦給ajax targetcontrolid。那就是退出。

相關問題