Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Evaluating and comparing with the DataBinder.Eval statement

Status
Not open for further replies.
Jun 9, 2006
159
US
Why can't I do something like this, or I should say "How" can I accomplish this kind of comparision withing a databound list control?

Code:
  <asp:Repeater ID="dl_Albums" runat="server">
                <ItemTemplate>
                      <div class="album">
                     
                     
<%# if (DataBinder.Eval(Container.DataItem, "AlbumId") == 3)
{ %>
     Some Text Is Written! 
<% } %>

</div>
</ItemTemplate>
</asp:Repeater>


Shawn Molloy
Seattle, WA
 
You should use the ItemDataBound event for conditional formatting such as this.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top