我的一gridview放入UpdatePanel中,结果发现删除功能不能用(点击删除无反应,IE状态栏显示网页有错误,但不知道错在哪)。如果把gridview放到UpdatePanel外面,就可以用,怎么回事。
奇怪的是:编辑功能不管是在UpdatePanel里还是外面都能用。
是不是要调整哪里。

解决方案 »

  1.   

    在triggers里是否加了关于rowdeleting的项?
    没开VS.也无法具体帮你看一下,能不能贴下代码?
      

  2.   

    <td style="height: 21px">
                <asp:ScriptManager ID="ScriptManager1" runat="server">
                            </asp:ScriptManager>
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                                AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" 
                                GridLines="None" HorizontalAlign="Center" 
                                onpageindexchanging="GridView1_PageIndexChanging" 
                                onrowcancelingedit="GridView1_RowCancelingEdit" 
                                onrowcreated="GridView1_RowCreated" onrowdeleting="GridView1_RowDeleting" 
                                onrowediting="GridView1_RowEditing" onrowupdating="GridView1_RowUpdating" 
                                PageSize="6" 
        onrowdatabound="GridView1_RowDataBound">
                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                <Columns>
                                    <asp:BoundField DataField="公告" DataFormatString="· {0}   " HeaderText="公告">
                                        <ItemStyle HorizontalAlign="Left" Wrap="False" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="类别" DataFormatString="· {0}   " HeaderText="类别" />
                                    <asp:BoundField DataField="编辑" DataFormatString="· {0}   " HeaderText="编辑人">
                                        <ItemStyle HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="日期" DataFormatString="· {0:yyyy-MM-dd}   " 
                                        HeaderText="日期" />
                                    <asp:CommandField HeaderText="编辑" ShowEditButton="True" />
                                    
                                    <asp:CommandField ShowDeleteButton="True" HeaderText="删除D" />
                                    <asp:CommandField HeaderText="选择S" ShowSelectButton="True" />
                                </Columns>
                                <PagerStyle BackColor="#336699" ForeColor="White" HorizontalAlign="Center" />
                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                <EditRowStyle BackColor="#999999" />
                                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                            </asp:GridView>
                        </ContentTemplate>
                    
                    </asp:UpdatePanel>
                </td>
      

  3.   

    是不是有Sys....什么之类的错误?如果是在WebConfig里添加
    <httpHandlers>
    <remove verb="*" path="*.asmx"/>
    <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>

    </httpHandlers>
      

  4.   

    找到错误了,gridview在UpdatePanel中,里面的事件不能使用page.response.write();