添加验证后,手风琴按钮不起作用

时间:2012-12-20 22:41:58

标签: asp.net jquery accordion

我遇到了一些奇怪的问题,找不到任何关于如何修复它的解决方案....我在手风琴的一个窗格上有详细视图,我在手风琴的另一个窗格上有一个gridview。 Everythingl工作得很好,直到我在detailview中的某些字段上添加了一些验证。验证工作正常,但问题是如果我在DetailView上保留验证控件,我的GridView上的编辑和更新按钮不会触发任何操作。如果我删除验证,则更新和编辑按钮将再次起作用..

下面是我的代码

<div id="accordion">
    <h3>ASection1</h3>
    <div>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>

            <asp:DetailsView ID="DV_Test" runat="server" Height="50px" Width="674px" AutoGenerateRows="False"
            CellPadding="4" oniteminserting="DV_Test_ItemInserting"  OnModeChanging="DV_Test_ModeChanging"           
            BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" 
            DefaultMode="Insert" BackColor="White" >
            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
            <RowStyle ForeColor="#330099" BackColor="White" />
                <InsertRowStyle BackColor="#E6E6FF" />
            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
            <Fields>

                <asp:TemplateField HeaderText="Please Input The Name">
                    <ItemTemplate>
                        <asp:Label ID="lblName" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Name") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtName" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Name") %>'></asp:TextBox>

                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ErrorMessage="*** This is a required field ***" ControlToValidate="txtName" Display="None" 
                            Font-Bold="True" ForeColor="#FF3300"></asp:RequiredFieldValidator>

                        <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" TargetControlID="RequiredFieldValidator1" HighlightCssClass="validatorCalloutHighlight">
                        </ajaxToolkit:ValidatorCalloutExtender>

                    </EditItemTemplate>
                </asp:TemplateField>


                <asp:CommandField ShowInsertButton="True" ButtonType="Button"></asp:CommandField>
            </Fields>
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
            <EditRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
        </asp:DetailsView>

       </div>

    </ContentTemplate> 
    </asp:UpdatePanel>
    </div>
    <h3>section2</h3>
    <div>
        <p>
        <asp:HiddenField ID="hidAccordionIndex" runat="server" Value="0" />

            <asp:GridView ID="GV_Test" runat="server" 
            AutoGenerateColumns="False" CellPadding="2"
            DataKeyNames="ID" ForeColor="Black" GridLines="None" 
            OnRowCancelingEdit="GV_Test_RowCancelingEdit"
            OnRowDeleting="GV_Test_RowDeleting"
             OnRowEditing="GV_Test_RowEditing" 
             OnRowUpdating="GV_Test_RowUpdating" BackColor="LightGoldenrodYellow" 
             BorderColor="Tan" BorderWidth="1px" Width="900px" EnableViewState="False">
            <FooterStyle BackColor="White" ForeColor="#000066" />
            <AlternatingRowStyle BackColor="PaleGoldenrod" />
            <Columns>
                    ...
                    ....

0 个答案:

没有答案