ListView Getting value in code behind aspx.cs file

This problem may be simple, but I am having problems with it. I have a listview and have an OnItemDeleting event configured to fire when an item is deleted. I would like to get the values ​​of the item that is being removed in this "OnItemDeleting" event in the value of the code. Can anyone give me any advice on how to do this?

=============================================== === ================================= An instance of the list in the .aspx file:

<asp:ListView ID="ListViewMngArtwork" runat="server" Visible="true" 
        DataKeyNames="artworkID" DataSourceID="SqlDataSourceMngArtwork" 
        GroupItemCount="3" OnItemDeleting="ListViewMngArtwork_OnItemDeleting"/>

      

=============================================== === ================================= Event instance in .aspx.cs file:

protected void ListViewMngArtwork_OnItemDeleting(object sender, EventArgs e)
{}

      

=============================================== === =================================

+3


source to share


1 answer


you can get the index, key and value of the Item in your event:



protected void ListViewMngArtwork_OnItemDeleting(object sender, ListViewDeleteEventArgs e)
{
    e.ItemIndex
    e.Keys
    e.Values
}

      

+5


source







All Articles