0
我有一个ASP.NET网站的中继器,我想只显示3记录 中继器:如何显示前3名的记录
<asp:Repeater ID="repNews" runat="server" DataSourceID="EntityDataSource1">
<ItemTemplate>
<ul>
<li><a href='<%# Eval("news_link")%>' > <asp:Label ID="lblNews" runat="server" Text='<%# Eval("news_title")%>' /></a></li>
</ul>
</ItemTemplate>
和实体模型
</asp:Repeater>
<asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=AGIP_dbEntities" DefaultContainerName="AGIP_dbEntities" EnableFlattening="False" EntitySetName="tbl_news" >
</asp:EntityDataSource>
您好,请阅读[常见问题]和[问]。然后回来编辑你的问题。 – Marco
向我们展示您的实体框架当前代码。 –
您可以使用.Take,https://msdn.microsoft.com/en-us/library/bb300906(v=vs.110).aspx – Adil