/ Published in: C#
Get number of record from ObjectDataSource if method returns ListT object.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// total label protected void ObjectDataSource1_Selected(object sender, ObjectDataSourceStatusEventArgs e) { if (e.Exception == null) { List<ActualGroup> DPcount = (List<ActualGroup>)e.ReturnValue; if (DPcount != null && DPcount.Count > 0) TotalLabel.Text = DPcount.Count.ToString(); else TotalLabel.Text = "0"; } }