注册 登录
编程论坛 ASP.NET技术论坛

“ASP.demanage_aspx”并不包含“GridView1_RowDeleting”的定义

水晶心 发布于 2010-08-11 09:32, 1512 次点击
<asp:Label ID="Label7" runat="server" Height="24px" Style="z-index: 108; left: 155px;
            position: absolute; top: 130px" Text="部门编号:" Width="83px"></asp:Label>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" OnRowDeleting="GridView1_RowDeleting" DataKeyNames = "did"
            AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966" BorderStyle="None"
            BorderWidth="1px" CellPadding="4" DataSourceID="SqlDataSource1"
            Height="242px" PageSize="8" Style="z-index: 109; left: 147px; position: absolute;
            top: 153px" Width="530px" >
            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
            <Columns>
                <asp:BoundField DataField="did" HeaderText="编号" ReadOnly="True" SortExpression="did" />
                <asp:BoundField DataField="dname" HeaderText="名称" SortExpression="dname" />
                <asp:BoundField DataField="dnum" HeaderText="人数" SortExpression="dnum" />
                <asp:CommandField ShowEditButton="True" />
                <asp:CommandField ShowDeleteButton="True" />
            </Columns>
            <RowStyle BackColor="White" ForeColor="#330099" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:kqConnectionString %>"
            SelectCommand="SELECT [did], [dname], [dnum] FROM [dep]" DeleteCommand="DELETE FROM [dep] WHERE [did] = @did" InsertCommand="INSERT INTO [dep] ([did], [dname], [dnum]) VALUES (@did, @dname, @dnum)" UpdateCommand="UPDATE [dep] SET [dname] = @dname, [dnum] = @dnum WHERE [did] = @did">
            
        </asp:SqlDataSource>
        &nbsp; &nbsp;
4 回复
#2
dgqstar2010-08-11 10:55
ASP.demanage_aspx.cs里没有GridView1_RowDeleting方法
#3
烟雨袅袅2010-08-11 13:48
   <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" OnRowDeleting="GridView1_RowDeleting" DataKeyNames = "did"
 
OnRowDeleting="GridView1_RowDeleting"删除了或是添加 GridView1_RowDeleting方法
#4
foktime2010-08-12 11:28
有时候吧 这错误信息已经告诉你该怎么做了
#5
zl406501942010-08-12 17:02
这很明显嘛,前台注册GridView1_RowDeleting事件了,后台没写事件处理啊
1