我怎么能一次确定在这个转发器中显示的行数?
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="News" EnableViewState="true"> <ItemTemplate> <hr /> <div style="color:#036e90; font-weight: bold; font-family:Tahoma; text-align:center ; padding-left:10px"><a href="displayNews.aspx"><%#DataBinder.Eval(Container.DataItem,"News_Name")%></a></div> <div style=" FONT-SIZE: 10pt; FONT-FAMILY: Tahoma ; text-align:center;padding-left:10px"><%#DataBinder.Eval(Container.DataItem,"News_Description")%></div> <br /> <hr /> </ItemTemplate> </asp:Repeater>
解决方法
经过大量的谷歌,我终于得到了答案:
((yourDataSourceDataType)rpttags.DataSource).Count之间
((yourDataSourceDataType)rpttags.DataSource).Count之间
其中rpttags是转发器的ID.
http://dotnetacademy.blogspot.com/2011/08/rowitem-count-in-repeater.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。