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()
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()