protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
DataRowView item = (DataRowView)e.Item.DataItem;
LinkButton hl = (Label)e.Item.FindControl("LinkButton1");
if (item["member_name"].ToString().Length > 5)
{
hl.Text = item["e_name"].ToString().Substring(0, 5) + "...";
}
else
{
hl.Text = item["e_name"].ToString();
}
}
}
datalist数据绑定时发生的事件
最新推荐文章于 2024-04-26 09:40:19 发布