确定asp.net中的转发器行数

前端之家收集整理的这篇文章主要介绍了确定asp.net中的转发器行数前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我怎么能一次确定在这个转发器中显示的行数?
<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之间

其中rpttags是转发器的ID.

http://dotnetacademy.blogspot.com/2011/08/rowitem-count-in-repeater.html

原文链接:https://www.f2er.com/aspnet/251161.html

猜你在找的asp.Net相关文章