ASP.NET 2.0,Repeater中FooterTemplate并无FindControl方法,也无法将FooterTemplate转成 RepeaterItem,虽然在Repeater的ItemDataBound事件中,RepeaterItemEventArgs参数用if (e.Item.ItemType == ListItemType.Footer)可判别出这个Footer,但其他时候不行。
目前找到的方法如下:
CheckBoxList SampleCheckBoxList = FooRepeater.Controls[FooRepeater.Controls.Count - 1].FindControl("SampleCheckBoxList ") as CheckBoxList;
我在FooterTemplate放了一个CheckBoxList。
也就是说FooterTemplate是Repeater控件中的最后一个控件。
目前找到的方法如下:
CheckBoxList SampleCheckBoxList = FooRepeater.Controls[FooRepeater.Controls.Count - 1].FindControl("SampleCheckBoxList ") as CheckBoxList;
我在FooterTemplate放了一个CheckBoxList。
也就是说FooterTemplate是Repeater控件中的最后一个控件。
本文介绍了在ASP.NET 2.0中如何处理Repeater控件的FooterTemplate部分,特别是如何提取放置在FooterTemplate中的CheckBoxList控件。由于Repeater的Footer部分没有提供FindControl方法,文中提供了一种解决方案来解决这个问题。
3648

被折叠的 条评论
为什么被折叠?



