ASP.NET Repeater bind List

前端 未结 7 438
遇见更好的自我
遇见更好的自我 2020-12-04 20:50

I am binding a List to a Repeater control. Now I want to use the Eval function to display the contents in ItemTemplate

7条回答
  •  失恋的感觉
    2020-12-04 21:03

    rptSample.DataSource = from c in lstSample select new { NAME = c };
    

    in the repeater you put

    <%# Eval("NAME") %>
    

提交回复
热议问题