0

ボタンをクリックすると、モーダルポップアップを表示する必要があります

ASPX コード:

   <section>

       <asp:Button ID="btnShowPopup" runat="server"  Text="EditContextMenu" Visible="true" OnClick="btnShowPopup_Click" />

     <ajax:ModalPopupExtender ID="ModalPopupContextInfo" runat="server" TargetControlID="btnShowPopup" PopupControlID="pnlpopupContextInfo"
           CancelControlID="imgClose" BackgroundCssClass="modalBackground">
       </ajax:ModalPopupExtender>

       <asp:Panel ID="pnlpopupContextInfo" runat="server" BackColor="White" Height="560px" Width="400px" Style="display: none" >
           <div class="contextMenu_edit" >
           <div class="context_menu">

         <p>Port</p>
          <asp:TextBox ID="txtCMEditPort" runat="server" MaxLength="10" Width="131px" TabIndex="1"></asp:TextBox>

         <div class="clear"></div>

         <p>ProformaETA</p>
         <asp:TextBox ID="txtCMEditProformaETA" runat="server" MaxLength="10" Width="131px" TabIndex="1"></asp:TextBox>
         <asp:ImageButton ID="imgbtnCMEditProformaETA" runat="server" ImageUrl="~/image_repository/calendarIcon.jpg" />
         <ajax:CalendarExtender ID="ajaxcalProfrmaETA" runat="server" TargetControlID="txtCMEditProformaETA" PopupButtonID="imgbtnCMEditProformaETA" Format="dd-MMM-yyyy"></ajax:CalendarExtender>

         <div class="clear"></div>

          <p>ProformaETD</p>
         <asp:TextBox ID="txtCMEditProformaETD" runat="server" MaxLength="10" Width="131px" TabIndex="1"></asp:TextBox>
         <asp:ImageButton ID="imgbtnCMEditProformaETD" runat="server" ImageUrl="~/image_repository/calendarIcon.jpg" />
         <ajax:CalendarExtender ID="ajaxcalProfrmaETD" runat="server" TargetControlID="txtCMEditProformaETD" PopupButtonID="imgbtnCMEditProformaETD" Format="dd-MMM-yyyy"></ajax:CalendarExtender>
    </div>
    </div>
       </asp:Panel>
</section>

コードビハインド:

           protected void btnShowPopup_Click(object sender, EventArgs e)
            {      
              ModalPopupContextInfo.Show();
            }

これは機能していません。

4

2 に答える 2

0

ModalPopupExtender で CancelControlID として使用する imgClose コントロールを定義するのを忘れました。

<ajax:ModalPopupExtender ID="ModalPopupContextInfo" runat="server"   TargetControlID="btnShowPopup" PopupControlID="pnlpopupContextInfo"
       CancelControlID="imgClose" BackgroundCssClass="modalBackground">

そのため、エクステンダーが機能しません。

于 2013-03-12T07:11:22.710 に答える
0

また、Model Popup Extender のアクティブ インデックスを設定する必要があります。ほとんどそれ

ASPX ページ :

"asp:button id="Button1" runat="server" text="DOWNTIME" cssclass="FormButton" width="20%"

"ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" BackgroundCssClass="ModalPopupBG" runat="server" TargetControlID="Button1" C​​ancelControlID="btnCancel1" PopupControlID="Panel1" Drag="true" PopupDragHandleControlID="PopupHeader"

それで

"asp:multiview id="MultiViewExpanse" runat="サーバー"" asp:View ID="ViewInput" runat="サーバー"

/asp:表示

/asp:マルチビュー

C#

protected void Page_Load(オブジェクト送信者, EventArgs e)

    {
        try
        {
            if (!IsPostBack)
            {
               ModalPopupContextInfo.ActiveViewIndex = 0;
            }
        }
     }

それは動作します...うまくいきます...それでも何かが必要な場合は..助けてください.... Ping me...

于 2013-03-12T07:26:49.297 に答える