本文介绍了我怎样才能从Repeater控件最后一条记录的价值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从中继器控制的最后一个记录的细节。有人可以帮忙吗?
I want to get the last record detail from repeater control. can someone help?
更多详细信息:
在我的数据库有插入的天数。过去的记录显示旅行团的总天数。所以我想从repea去年记录值
more detail :in my database there is number of days inserted. the last record shows the total days of tours. so i want that last record value from repea
推荐答案
在code后面可以使用的ItemDataBound
事件得到最后一个项目的细节
In code behind you can use the ItemDataBound
event to get the details of the last item:
protected void rpt_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item ||
e.Item.ItemType == ListItemType.AlternatingItem)
{
if (e.Item.ItemIndex == rpt.Items.Count - 1)
{
// this repeater item refers to the last record
}
}
}
这篇关于我怎样才能从Repeater控件最后一条记录的价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!