我是这个网站和 asp.net 的新手(我来自经典的 asp 背景)。我希望有人可以帮我为中继器添加分页功能?我尝试按照我发现的其他一些教程进行操作,但我一直在碰壁。这是我的代码:
<form runat="server">
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
<ItemTemplate>
<div class="middlebar"><!--middlebar -->
<div class="middlebartext"><!--middlebartext -->
<small><asp:Label runat="server" ID="Label5"text='<%# Eval("PMonthName")%>' /><br /><asp:Label runat="server" ID="Label6" text='<%# Eval("PDay")%>' /></small>
</div><!--middlebartext -->
<div class="middlebarcorner"><img src="Images/cornermiddle.png" alt="Corner Ribbon Image" /></div><!--middlebarcorner -->
<div class="middlebartexttitle"><asp:Label runat="server" ID="Label3"
text='<%# Eval("Header")%>' /><br />
<div class="middletextauth">Added By: <asp:Label runat="server" ID="Label2"
text='<%# Eval("AddedBy")%>' /></div><!--middletextauth -->
<div class="middletextkw">Keywords: <span class="grey">key, words, test, file</span></div><!--middletextkw -->
</div><!--middlebartexttitle -->
</div><!--middlebar -->
<br />
<asp:Label runat="server" ID="Label4"
text='<%# Eval("PContent")%>' />
<div class="ruler"></div>
</ItemTemplate>
</asp:Repeater>
</form>
<asp:SqlDataSource
ConnectionString=
"<%$ ConnectionStrings:Conn %>"
ID="SqlDataSource1" runat="server"
SelectCommand="SELECT * from DBNAME where Deleted = 'False' Order By DateAdded DESC">
</asp:SqlDataSource>