0
我有一个公共类和一个公共列表。如何访问代码后面的列表变量aspx页面
public List<yahoo> yahooRec = new List<yahoo>();
public class yahoo
{
public string url { get; set; }
public string title { get; set; }
public string descripton { get; set; }
}
我的清单得到它的值在foreach循环中。我只是想用我的名单在一个中继器
<asp:Repeater id="Rep" runat="server">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%= yahoorec.url %>' Text='<%= yahoorec.title %>' />
<p> <%= yahoorec.description %> </p>
</ItemTemplate>
</asp:Repeater>
但它不工作。任何人都可以帮助我吗?