c# - Display content in Repeater -


i must have done can print repeater, such can not write content want do.

i have written code this

forum.aspx

<asp:repeater id="repeaterkommentar" runat="server">                 <itemtemplate>                     <div class="kommentarbox">                         <%--print content here--%>                     </div>                 </itemtemplate>             </asp:repeater> 

forum.aspx.cs

var userskommentar = kommentara in db.forumkommentars                          join brugerea in db.brugeres on kommentara.brugerid equals brugerea.id                          kommentara.forumid == getid                          orderby kommentara.id descending                          select new                          {                              username = brugerea.fornavn + " " + brugerea.efternavn                          };      repeaterkommentar.datasource = userskommentar;     repeaterkommentar.databind(); 

the problem, i'm not entirely sure how access object of enumerable through data source.

i'm not sure data exist within object, you've bound repeater , called data bind. need call:

<%# eval("...") %> 

the ... represent name of column, or property.


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -