bind the repeater
i have to show only top 4 blogs on the home page, then how can i will bind the select statement on repeater through lambda expression.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question.
Nanhe SiddiquePosted May 23, 2015, 3:18 AM
Vincent Maverick DuranoPosted May 23, 2015, 3:13 AM
You don't actually need a lambda expression for that. Instead you can use the LINQ Take operator:
var query = db.Models.Take(4);
Repeater1.DataSource = query;
Repeater1.DataBind();