当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > Repeater的FooterTemplate中控件内容设置方法

ASP.NET
Web服务器控件:LinkButton控件
Web服务器控件:ListBox控件
Web服务器控件:ListItem控件
Web服务器控件:Literal控件
Web服务器控件:Panel控件
Web服务器控件:PlaceHolder控件
Web服务器控件:RadioButton控件
Web服务器控件:RadioButtonList控件
Web服务器控件:BulletedList控件
Web服务器控件:Style控件
Web服务器控件:Table控件
Web服务器控件:TableCell控件
Web服务器控件:TableRow控件
Web服务器控件:TextBox控件
Web服务器控件:XML控件
Validation服务器控件:CompareValidator控件
Validation服务器控件:CustomValidator控件
Validation服务器控件:RangeValidator控件
Validation服务器控件:RegularExpressionValidator控件
Validation服务器控件:RequiredFieldValidator控件

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-01-10   浏览: 167 ::
收藏到网摘: n/a

Repeater的FooterTemplate中控件内容设置方法,需要的朋友可以参考下。 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控件中的最后一个控件。