ASP.NET - 如何在更新面板

时间:2015-09-29 04:54:01

标签: asp.net

我有一个带有模态弹出面板(PN)的项目 - 当我点击一个按钮(btn_sendemail)时,这个PN会显示,PN有更新面板,其中包含用户选择的电子邮件帐户列表(通过选中复选框选择) 。更新面板具有触发异步回发(按钮确定)。 当用户单击“确定”时 - 系统将检查用户是否已选择任何复选框以选择任何电子邮件帐户,并在用户未选择一次时显示警报。如果为真,系统将显示警报(发送电子邮件确定),我需要按钮确定.enable = false - 但它不是work.bellow是我的代码,请告诉我一些事情,如果你有: ASPX:

<cc1:ModalPopupExtender ID="ModalPopupExtender4" runat="server" BehaviorID="mpe4" PopupControlID="Panel4" TargetControlID="HiddenField4" BackgroundCssClass="modalBackground"  DropShadow="true"  >
    </cc1:ModalPopupExtender  >
    <asp:HiddenField ID="HiddenField4"  runat="server" />
    <asp:Panel ID="Panel4" runat="server" CssClass="modalPopup01" Style="display:block; width:800px;">
    <div class="header01">
           <%-- Information Save data--%>
           Content Email</div>
         <div class="body01" style=" padding:3px;">

         <br />
             <asp:TextBox ID="txt_content_zzz" runat="server" Height="50px" TextMode="MultiLine" 
                 Width="400px"></asp:TextBox>
            <br /> <br />
            <asp:UpdatePanel runat="server" ID="up_pnl_1" UpdateMode="Conditional"><ContentTemplate>
            <div style="height:420px; width:100%; overflow:scroll ">
            <asp:GridView ID="dgv_email" runat="server" AutoGenerateColumns="False" 
                 Width="100%" DataSourceID="dts_Search" CellPadding="4" ForeColor="#333333" 
                 GridLines="Both"  style="max-height:400px;overflow:scroll"  >
                 <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                 <Columns>

                    <asp:TemplateField HeaderText="Check Email">
                <ItemTemplate >
                    <asp:CheckBox ID="chk_JV_check"  Width="30%" runat="server" Checked="false"  AutoPostBack="false"  />
                </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" />
               </asp:TemplateField>
                     <asp:BoundField DataField="user_email" HeaderText="Email address" />

                   <asp:TemplateField HeaderText="CC_mail">
                <ItemTemplate >
                    <asp:CheckBox ID="chk_ccmail"  Width="30%" runat="server" Checked="false"  AutoPostBack="false"  />
                </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" />
               </asp:TemplateField>

               <asp:BoundField DataField="user_email" HeaderText="CC Email address" />
                 </Columns>
             </asp:GridView>
            </div>
            </ContentTemplate>
            <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btn_OK" />
            </Triggers>
            </asp:UpdatePanel>


             <asp:Button ID="btn_OK" runat="server" Text="OK" Height="26px" Width="84px" autopostback="true"  />
          <asp:Button ID="btn_cancel" runat="server" Text="Close" 
                 OnClientClick="return HideModalPopup_04()" Height="26px" Width="84px" />           
            <asp:SqlDataSource ID="dts_Search" runat="server">
            </asp:SqlDataSource>

asp - vb.net:

if checking false then
            s_mess = "alert('Please choose at least an email');"
            ScriptManager.RegisterStartupScript(Me, GetType(String), "alert", s_mess, True)

        Else -- checking true                                
            Try
                If GuiMailThongBao() = True Then

                    ssql = "insert... + "'"
                    save_record(ssql)
                    btn_send_mail.Enabled = False                   

                    s_mess = "alert('Send OK!!!');"
                    ScriptManager.RegisterStartupScript(Me, GetType(String), "alert", s_mess, True)

                    btn_OK.Enabled = False

                Else
                    s_mess = "alert('Send error!!!');"
                    ScriptManager.RegisterStartupScript(Me, GetType(String), "alert", s_mess, True)
                End If
            Catch ex As Exception

            End Try

0 个答案:

没有答案