使用更新面板时按钮不起作用

时间:2014-07-07 05:05:43

标签: c# asp.net

我在页面中有3个引导标签。在第一个和第三个选项卡按钮中,它们不起作用,但第二个选项卡中的按钮工作正常。在第二个选项卡中,我有一个更新面板来回发下拉列表,因为我想显示像bootstrap模式脚本和第二个选项卡上的按钮工作正常。你能告诉我它为什么会这样吗?我该怎么做?

我的问题很难解释。我想使用为什么选项卡中的按钮不起作用,但在第二个选项卡中工作正常。当我在第二个选项卡中完成功能时,第一个选项卡中的按钮正在工作。为什么会这样?我很迷茫。非常感谢你。

这是带有函数模式的.aspx中的代码:

<div class="tab-pane fade" id="profile">
    <%--modal  --%>   
    <button type="button" id="aaa" data-toggle="modal" data-target="#download" class="btn btn-primary btn-lg">เพิ่มรายการใหม่</button>
    <div class="modal fade" id="download" tabindex="-1" role="dialog" aria-labelledby="downloadlabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="downloadlabel">
                    <asp:Label ID="usrl" runat="server"></asp:Label>
                    <br />
                    <asp:Label ID="detail" runat="server"></asp:Label></h4>
                </div>
                <div class="modal-body">
                    <p>
                        <strong>Request Section</strong><br /><br />                         
                    </p>                        
                    <asp:ScriptManager ID="ScriptManager1" runat="server" />
                    <asp:Panel ID="Panel1" runat ="server">
                        <asp:UpdatePanel ID="update" UpdateMode="Conditional" runat="server">
                            <ContentTemplate>
                                <div class="formItem">
                                    <div class="form-group">
                                        <asp:Label ID="Label6" runat="server"><b>Item Code: </b></asp:Label>
                                        <asp:TextBox ID="itm_code" CssClass="form-control" runat="server" required="required"></asp:TextBox>
                                    </div>
                                </div>                        
                                <div class="formItem">
                                    <div class="form-group">
                                        <asp:Label ID="Label7" runat="server"><b>Item Description: </b></asp:Label>
                                        <asp:TextBox ID="itm_desc" CssClass="form-control" runat="server" required="required"></asp:TextBox>
                                    </div>
                                </div>
                                <div class="formItem">
                                    <div class="form-group">
                                        <asp:Label runat="server"><b>Order Category: </b></asp:Label>
                                        <asp:DropDownList ID="ord_cat" CssClass="form-control" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ord_cat_SelectedIndexChanged">
                                            <asp:ListItem Value="0" Text="Chosse Order Category"></asp:ListItem>
                                        </asp:DropDownList>
                                    </div>
                                </div>                 
                                <div class="formItem">
                                    <div class="form-group">
                                        <asp:Label runat="server"><b>Order Subcategory / Department in Lab: </b></asp:Label>
                                        <asp:DropDownList ID="ord_subCat" CssClass="form-control" runat="server">
                                            <asp:ListItem Value="0" Text="Chosse Order Subcategory"></asp:ListItem>
                                        </asp:DropDownList>
                                    </div>
                                </div>
                                <div class="formItem">
                                    <div class="form-group">
                                        <asp:Label ID="Label11" runat="server"><b>Billing Group: </b></asp:Label>
                                        <asp:DropDownList ID="ord_bg" CssClass="form-control" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ord_bg_SelectedIndexChanged">
                                            <asp:ListItem Value="0" Text="Chosse Billing Group"></asp:ListItem>
                                        </asp:DropDownList>
                                    </div>
                                </div>
                                <div class="formItem">
                                    <div class="form-group">
                                        <asp:Label ID="Label14" runat="server"><b>Billing SubGroup: </b></asp:Label>
                                        <asp:DropDownList ID="ord_bsg" CssClass="form-control" runat="server">
                                            <asp:ListItem Value="0" Text="Chosse Billing Sub Group"></asp:ListItem>
                                        </asp:DropDownList>
                                    </div>
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </asp:Panel>
                    <div class="formItem">
                        <div class="form-group">
                            <asp:Label runat="server"><b>Service Cat: </b></asp:Label>
                            <asp:TextBox ID="ord_svc" CssClass="form-control" runat="server"></asp:TextBox>
                        </div>
                    </div>
                    <div class="formItem">
                        <div class="form-group">
                            <asp:Label runat="server"><b>Alias Name / Synonym in Lab: </b></asp:Label>
                            <asp:TextBox ID="ord_asn" CssClass="form-control" runat="server" required="required"></asp:TextBox>
                        </div>
                    </div>
                    <div class="formItem">
                        <div class="form-group">
                            <asp:Label runat="server"><b>Cost Price: </b></asp:Label>
                            <asp:TextBox ID="ord_cp" CssClass="form-control" runat="server" required="required"></asp:TextBox>
                        </div>
                    </div>
                    <div class="formItem">
                        <div class="form-group">
                            <div class="form-inline">
                                <asp:Label runat="server"><b>OPD Price: </b></asp:Label>
                                <asp:TextBox ID="OPD_price" size="7" CssClass="form-control" runat="server" required="required"></asp:TextBox>
                                <asp:Label runat="server"><b>IPD Price: </b></asp:Label>
                                <asp:TextBox ID="IPD_price" size="7" CssClass="form-control" runat="server" required="required"></asp:TextBox>
                                <asp:Label runat="server"><b>Tourist Price: </b></asp:Label>
                                <asp:TextBox ID="TOU_price" size="7" CssClass="form-control" runat="server" required="required"></asp:TextBox>
                            </div>
                        </div>
                    </div>
                    <div class="formItem">
                        <div class="form-group">
                            <asp:Label runat="server"><b>File upload</b></asp:Label>
                            <asp:FileUpload ID="fileupload" runat="server" />
                            <p class="help-block" style="color: #FF852C">โปรดระบุ เอกสารแนบท้ายเพิ่มเติมกรณี (ถ้ามี)</p>
                        </div>
                    </div>
                    <div class="formItem">
                        <div class="form-group">
                            <asp:Label runat="server"><b>Send to DF: </b></asp:Label>
                            <asp:RadioButtonList ID="ord_sdf" runat="server" CssClass="required">                                       
                                <asp:ListItem Value="Yes" Text="Yes"></asp:ListItem>
                                <asp:ListItem Value="No" Text="No"></asp:ListItem>
                            </asp:RadioButtonList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator" runat="server" ControlToValidate="ord_sdf" ErrorMessage="Please select some other choice.">
                            </asp:RequiredFieldValidator>
                        </div>
                    </div>          
                    <div class="formItem">
                        <div class="form-group">
                            <asp:Label runat="server"><b>Remark: </b></asp:Label>
                            <asp:TextBox ID="ord_rmk" TextMode="MultiLine" CssClass="form-control" runat="server"></asp:TextBox>
                        </div>
                    </div>                       
                </div>
                <div class="modal-footer">
                    <asp:Button ID="btn_insert" CssClass="btn btn-danger" Text="INSERT ITEM" runat="server" OnClick="btn_insert_Click" />         
                    <button type="button" class="btn btn-info" data-dismiss="modal">Close</button>
                </div>
            </div>
        </div>
    </div>
标签1中的

代码

<div class="tab-content">                 
    <div class="tab-pane fade in active" id="home">
        <div class="search">
            <div class="form-inline">
                <div class="group-search">
                    <asp:Label ID="Label12" Text="Item Code : " runat="server" CssClass="control-label" Font-Bold ="true"></asp:Label>
                    <asp:TextBox ID="search_ic" runat="server" CssClass="form-control"></asp:TextBox>
                    <asp:Label ID="Label13" Text="Item Description : " runat="server" CssClass="control-label" Font-Bold ="true"></asp:Label>
                    <asp:TextBox ID="search_id" runat="server" CssClass="form-control"></asp:TextBox>                            
                    <asp:Button ID="btn_search" Text="Search" runat="server" CssClass="btn btn-default" OnClick="btn_search_Click" />
                    <asp:Label ID="txt_alert" Text="กรุณากรอก Item Code หรือ Item Description" runat="server" CssClass="form-control" Visible="false"></asp:Label>
                </div>
            </div>
        </div>
        <%--gridview for update--%>
        <div class="meddle2">
            <asp:GridView ID="gridview" runat="server" AutoGenerateColumns="False" 
                OnDataBound="gridview_DataBound" 
                OnRowCancelingEdit="gridview_RowCancelingEdit" 
                OnRowEditing="gridview_RowEditing" OnRowUpdated="gridview_RowUpdated" 
                CssClass="table table-hover table-striped">
                <Columns>
                    <asp:CommandField ShowEditButton="True" HeaderStyle-BackColor="#D4E6ED" ControlStyle-CssClass="btn btn-primary" ButtonType="Button" HeaderStyle-Width="80">
                        <ControlStyle CssClass="btn btn-primary"></ControlStyle>
                        <HeaderStyle Width="80px"></HeaderStyle>
                    </asp:CommandField>
                    <asp:TemplateField HeaderText="No." HeaderStyle-BackColor="#D4E6ED">
                        <ItemTemplate>
                            <asp:Label ID="lblnum"  runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.num") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Item Code" HeaderStyle-BackColor="#D4E6ED">
                        <ItemTemplate>
                            <asp:Label ID="lblIC" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.item_code") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txt_ic" runat="server" size="6" CssClass="form-control" Text='<%# DataBinder.Eval(Container, "DataItem.item_code") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Item Description" HeaderStyle-BackColor="#D4E6ED">
                        <ItemTemplate>
                            <asp:Label ID="lblID" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.item_des") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txt_id" runat="server" size="10" CssClass="form-control" Text='<%# DataBinder.Eval(Container, "DataItem.item_des") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Existing OPD Price" HeaderStyle-BackColor="#D4E6ED">
                        <ItemTemplate>
                            <asp:Label ID="lblEOP" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.eop") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txt_eop" runat="server" size="10" CssClass="form-control" Text='<%# DataBinder.Eval(Container, "DataItem.eop") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>

                    <asp:TemplateField HeaderText="Existing IPD Price" HeaderStyle-BackColor="#D4E6ED">
                        <ItemTemplate>
                            <asp:Label ID="lblEIP" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.eip") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txt_eip" runat="server" size="10" CssClass="form-control" Text='<%# DataBinder.Eval(Container, "DataItem.eip") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Existing Tourist Price" HeaderStyle-BackColor="#D4E6ED">
                        <ItemTemplate>
                            <asp:Label ID="lblETP" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.etp") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txt_etp" runat="server" size="10" CssClass="form-control" Text='<%# DataBinder.Eval(Container, "DataItem.etp") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>

                    <asp:TemplateField HeaderText="New OPD Price" HeaderStyle-BackColor="#D4E6ED">
                        <ItemTemplate>
                            <asp:Label ID="lblNOP" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.nop") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txt_nop" runat="server" size="10" CssClass="form-control" Text='<%# DataBinder.Eval(Container, "DataItem.nop") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="New IPD Price" HeaderStyle-BackColor="#D4E6ED">
                        <ItemTemplate>
                            <asp:Label ID="lblNIP" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.nip") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txt_nip" runat="server" size="10" CssClass="form-control" Text='<%# DataBinder.Eval(Container, "DataItem.nip") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="New Tourist Price" HeaderStyle-BackColor="#D4E6ED">
                        <ItemTemplate>
                            <asp:Label ID="lblNTP" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.ntp") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txt_ntp" runat="server" size="10" CssClass="form-control" Text='<%# DataBinder.Eval(Container, "DataItem.ntp") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Margin OPD Price" HeaderStyle-BackColor="#D4E6ED">
                        <ItemTemplate>
                            <asp:Label ID="lblmop" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.mop") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txt_mop" runat="server" size="10" CssClass="form-control" Text='<%# DataBinder.Eval(Container, "DataItem.mop") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Margin IPD Price" HeaderStyle-BackColor="#D4E6ED">
                        <ItemTemplate>
                            <asp:Label ID="lblmip" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.mip") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txt_mip" runat="server" size="10" CssClass="form-control" Text='<%# DataBinder.Eval(Container, "DataItem.mip") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Margin Tourist Price" HeaderStyle-BackColor="#D4E6ED">
                        <ItemTemplate>
                            <asp:Label ID="lblmtp" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.mtp") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txt_mtp" runat="server" size="10" CssClass="form-control" Text='<%# DataBinder.Eval(Container, "DataItem.mtp") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:HiddenField ID="hdf" runat="server" />
        </div>
    </div>

0 个答案:

没有答案