I have a website that creates labels through an item template.
Here is the code in the page
The sqldatasource also has an "Environment" and what I want to be able to do is code a conditional statement like this:
So i need to be able to evaluate the "Environment" for any given label within the itemtemplate and shade the backcolor for a given criteria.
How can I do this in the code behind?
Here is the code in the page
Code:
<itemtemplate>
<asp:Label runat="server" ID="lblDefect" Text='<%# Eval("Application") +" "+ Eval("Duration")%>' ToolTip='<%# "Defect ID#" & Eval("Defect") & " - " & Eval("DetectedInCycle")%>'></asp:Label>
</itemtemplate>
The sqldatasource also has an "Environment" and what I want to be able to do is code a conditional statement like this:
Code:
If "Environment" = "QA 02" then
label.backcolor = vbRed
elseif "Environment" = "QA 03" then
label.backcolor = vbBlue
else...
end if
So i need to be able to evaluate the "Environment" for any given label within the itemtemplate and shade the backcolor for a given criteria.
How can I do this in the code behind?