Click here to Skip to main content
14,984,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have more than one repeater I want to change td color depend on data from database

I have relationship with user and role but not all user have role
so I want to change td color as gray where the user has a role and if the user does not have a role I want to be with different color

where DataBinder = RoleName

What I have tried:

<asp:Repeater ID="UserRepeater" runat="server" OnItemCommand="UserRepeater_ItemCommand">
<itemtemplate>





<%#DataBinder.Eval(Container.DataItem, "RoleName") %>

<asp:LinkButton ID="LinkButton1" runat="server" CommandName="Edit"
CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ID") %>' Text='<%# DataBinder.Eval(Container.DataItem, "Name") %>' OnClickHandler="OnClickHandler" ForeColor="Black">


<asp:LinkButton ID="lnkDelete" runat="server" CommandName="delete" OnClientClick='javascript:return confirm("Are you sure you want to delete this contact?")'
CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ID") %>'>/Delete

<%# DataBinder.Eval(Container.DataItem, "ExtNumber") %>


<asp:LinkButton ID="LinkButton2" runat="server" CommandName="Edit"
CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ID") %>' Text='<%# DataBinder.Eval(Container.DataItem, "ArabicName") %>' OnClickHandler="OnClickHandler" ForeColor="Black" >

<%# DataBinder.Eval(Container.DataItem, "RoleArabicName") %>
Posted
Updated 11-Sep-17 22:07pm
v2
Comments
Richard Deeming 12-Sep-17 15:42pm
   
It looks like the site has swallowed some of your code. Try editing your question and pasting the code again. If you get the "paste as" popup, select "code block". Otherwise, select the code, and click the "code" button in the toolbar.

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