Microsoft Access: Yet another delete command problem with the DataView control - please help

  • rsg2bson / 102 / Mon, 14 Dec 2009 18:55:00 GMT / Comments (0)
  • Hello all,

    I'm having the same issue that I've seen in several posts in this forum, but none of the resolutions fix my issue. I'm using an ObjectDataSource and a DataView control to display a simple list of data. I added a LinkButton control with a CommandName of "Delete" to the ItemTemplate. I've verified that the DataView has the DataKeyField properly set. When the Delete button is clicked, the page reloads, but the record does not delete. I've set a break point on the method that the ObjectDataSource is configured to use and it does not fire. What could I be missing?? Aslo, I do not have anything in the code behind file. Below is the code of my ASPX page.

    <%...PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default" %>

    <!

    DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <

    htmlxmlns="http://www.w3.org/1999/xhtml">

    <

    headrunat="server">

    <title>Untitled Page</title>

    </head>

    <body>

    <formid="form1"runat="server">

    <div>

    <asp:ObjectDataSourceID="ObjectDataSource1"runat="server"DataObjectTypeName="Blog.Category"

    DeleteMethod="RemoveCategory"SelectMethod="GetCategories"TypeName="Blog.BlogManger">

    </asp:ObjectDataSource>

    </div>

    <asp:DataListID="DataList1"runat="server"DataKeyField="CategoryId"DataSourceID="ObjectDataSource1">

    <ItemTemplate>

    CategoryId:

    <asp:LabelID="CategoryIdLabel"runat="server"Text='<%# Eval("CategoryId") %>'></asp:Label><br/>

    Name:

    <asp:LabelID="NameLabel"runat="server"Text='<%# Eval("Name") %>'></asp:Label><br/>

    Description:

    <asp:LabelID="DescriptionLabel"runat="server"Text='<%# Eval("Description") %>'></asp:Label><br/>

    <br/>

    <asp:LinkButtonID="LinkButton1"runat="server"CommandName="Delete">Delete</asp:LinkButton><br/>

    </ItemTemplate>

    </asp:DataList>

    </form>

    </body>

    </html>

    Any help would be greatly appreciated. Thanks in advance.

    Russ

  • Keywords:

    delete, command, dataview, control, microsoft, access

  • http://www.edevs.com/ms-access-database/240/«« Last Thread - Next Thread »»