I have a Repeater control that is being bound to the result of a Linq query.
I want to get the value of one of the datasource's fields in the ItemDataBound event, but I'm not sure how to do this.
I have a Repeater control that is being bound to the result of a Linq query.
I want to get the value of one of the datasource's fields in the ItemDataBound event, but I'm not sure how to do this.
Depending on the DataSource... If your DataSource is a DataTable, then your DataItem contains a DataRowView:
You can use:
e.Item.DataItem
.Example: Repeater.ItemDataBound Event
The data that is used for the current item can be found from the EventArgs.