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
Hey guys.I need some help with a problem that i am experiencing trying to add an edit column to my d...
By gavw
I have an vb6 application that uses ado data access and has a lot of bound controls, mostly text box...
By hbb
Can someone explain this for us. I have a data table with many fields so in my BLL I divided up the...
By mtsonic
Can I connect to an ADABAS database from .NET?...
By julesarcher
Hello,I have an Access database with 2 tables: News and News_Localized.Table "News" has 2 fields "Ar...
By shapper, 4 Comments
Hello friends,i have a big problem. I developed an ASPX site that allows me to control my DB (Update...
By foxmac, 3 Comments
Hi everyone, I have this instructer whose telling me that on the job(realtime) we never drag a...
By always_another_way, 3 Comments
Hello .NET developers,I am currently writing a asp.net app in which I am going to need to try to get...
By kramish, 4 Comments
Hi All,I am the newcomer to ASP/VB.NET and am having trouble with the following.I want to read some ...
By cartedc, 1 Comments