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.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Vincent Maverick DuranoRank #238 · 10.3K reputationPosted May 22, 2015, 11:13 PM EDT
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();
Nanhe SiddiqueRank #1,103 · 1.7K reputationPosted May 22, 2015, 11:18 PM EDT