Click here to Skip to main content
15,888,330 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I have binded the repeater data source in my code behind page and data is binding to the repeater control.But it is not showing in my browser.my code for repeater control is as follows..
C#
<table>
<tr>
<td class="tdHeaderDoc">
                                <table>
 <asp:Repeater ID="rptStatusReport" runat="server" ClientIDMode="AutoID">
       <ItemTemplate>

     <%# (Container.ItemIndex + 3) % 3 == 0 ? "<tr>" : string.Empty%>
    <td style="padding-removed 5px;">
<span class="delete"><a >x</a> </span>
<br />
<div class="doc_main" >
<span class="doc_bg"></span>
 <span class="doc_text" style="background-color: <%# Eval("FileType").ToString().ToUpper() == "PDF"? "red":  Eval("FileType").ToString().ToUpper() == "DOC"? "blue" : Eval("FileType").ToString().ToUpper() == "XLS" || Eval("FileType").ToString().ToUpper() == "XLXS"? "green" : "black" %>" title="<%# Eval("FileName") %>"><%# Eval("FileType").ToString().ToUpper() %></span>
 </div>
   <br />
  </td>
 <%# (Container.ItemIndex + 3) % 3 == 2 ? "</tr>" : string.Empty%>
</ItemTemplate>
 </asp:Repeater>
</table>
 </td>
</tr>
</table>


And my code in aspx.cs page is
statusReportDocuments = statusReportDocsUtility.GetStatusReportByID(id);

rptStatusReport.DataSource = statusReportDocuments.OrderBy(n => n.FileName).ToList();
rptStatusReport.DataBind();
Posted
Comments
[no name] 19-Nov-15 3:44am    
What is problem actually? Whether is repeater is displaying but not data or nothing is displaying(neither repeater nor data). Can you just use browser developer tool what is actually rendering in browser.

Secondly make sure that you have data in DataSource.
Member 11246037 19-Nov-15 3:47am    
it is not displaying the repeater as well as the data.
[no name] 19-Nov-15 3:54am    
As I asked in my previous comment did you check whether table is rendered in browser.
Is there any css property making it hide. Please recheck it.
Sinisa Hajnal 20-Nov-15 5:53am    
1. Check that you have the data
2. Check that rows are properly created (you have that condition that every third row doesn't render or something like that)
3. After this block : <%# Eval("FileType").ToString().ToUpper() %></span> everything is colored as string, check that all quotes are closed properly
4. Remove all HTML from there and just put <%# Eval("FileType").ToString() %> or some other field and check that it renders, then start adding more things inside.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900