Hello -
I am trying to bind data retrieved in the code-behind using Linq to a repeater control on the presentation layer. How do I access the objects stored in 'results' on the presentation layer? Basically, what needs to go between the <% %> on the aspx file? Thanks!!
protected void Page_Load(object sender, EventArgs e)
{
MilitaryAvenueDataContext db = new MilitaryAvenueDataContext();
var results = from l in db.PartnerListings where l.StatusID == 3 && l.InstallationID == 1 select l;
Repeater1.DataSource = results;
Repeater1.DataBind();
}
<form id="form1" runat="server">
<div>
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
Header Info Here</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text="<% %>"></asp:Label></ItemTemplate>
<FooterTemplate>
Footer Info Here</FooterTemplate>
</asp:Repeater>
</div>
</form>