ListView OnItemDelete

S

Steve Wofford

How do I pass the DataKeyName of my ListView to my OnItemDelete.

My List View

<asp:ListView ID="lvSubmittalStatus" runat="server"
DataKeyNames="submittalstatusID"
ItemPlaceholderID="itemPlaceholderSubmittalStatus"
OnItemDeleting="lvSubmittalStatus_ItemDeleting">

VB.NET Code:

Protected Sub lvSubmittalStatus_ItemDeleting(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.ListViewDeleteEventArgs)

Dim deleteSubmittalStatus = From s In db.gi_submittalstatus _
Where s.submittalstatusID = *?*Data Key
Name Value*?*
Select s
db.gi_submittalstatus.DeleteOnSubmit(s)
db.SubmitChanges()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top