信息发布→ 登录 注册 退出

Repeater的FooterTemplate中控件内容设置方法

发布时间:2026-01-11

点击量:
Repeater中FooterTemplate并无FindControl方法,也无法将FooterTemplate转成RepeaterItem,虽然在Repeater的ItemDataBound事件中,RepeaterItemEventArgs参数用if (e.Item.ItemType == ListItemType.Footer)可判别出这个Footer,但其他时候不行。

目前找到的方法如下:

复制代码 代码如下:
((Literal)rep2.Controls[rep2.Controls.Count - 1].FindControl("rep2Sum")).Text = ss.ToString();


我在FooterTemplate放了一个Literal。
也就是说FooterTemplate是Repeater控件中的最后一个控件。
在线客服
服务热线

服务热线

4008888355

微信咨询
二维码
返回顶部
×二维码

截屏,微信识别二维码

打开微信

微信号已复制,请打开微信添加咨询详情!