[英]ListView Retrieving Value in Code Behind File aspx.cs
This issue may be simple but I am having some trouble with it. 这个问题可能很简单,但我遇到了一些问题。 I have a listview and have an "OnItemDeleting" event set up to fire as the item is deleted.
我有一个listview并设置了一个“OnItemDeleting”事件,以便在项目被删除时触发。 I would like to retrieve the values of the item that is being deleted in this "OnItemDeleting" event in the code behind value.
我想在代码隐藏值中检索此“OnItemDeleting”事件中正在删除的项的值。 Could anyone give me any tips on how to go about doing this?
谁能给我任何关于如何做到这一点的提示?
=================================================================================== Listview instance in .aspx file: ================================================== ================================= .aspx文件中的Listview实例:
<asp:ListView ID="ListViewMngArtwork" runat="server" Visible="true"
DataKeyNames="artworkID" DataSourceID="SqlDataSourceMngArtwork"
GroupItemCount="3" OnItemDeleting="ListViewMngArtwork_OnItemDeleting"/>
=================================================================================== Event instance in .aspx.cs file: ================================================== ================================= .aspx.cs文件中的事件实例:
protected void ListViewMngArtwork_OnItemDeleting(object sender, EventArgs e)
{}
=================================================================================== ================================================== =================================
you can get the Item index, key and value in your event: 您可以在事件中获取Item索引,键和值:
protected void ListViewMngArtwork_OnItemDeleting(object sender, ListViewDeleteEventArgs e)
{
e.ItemIndex
e.Keys
e.Values
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.