This topic is locked
[SOLVED]

Row Color based on value in Database

12/19/2022 1:33:52 PM
ASPRunner.NET General questions
S
SaulHulse author

Hi.
I want to change the Bacground of the entire row depending of the value in a Database field.
in the ListPage: After Record processed I have this line of cod:
record["css"] = "background:'"+data["Zonecolor"].ToString()+"';";

img alt

Thanks for the help.

Pete K 12/19/2022

Your code looks right. Are you sure yoyu have a valid value for the CSS color in the database field? If it's expressed as hex, did you remember to include "#"?

Pete K 12/19/2022

Wait, I just noticed the single quotes wrapping the value. You don't need those.

S
SaulHulse author 12/19/2022

Hi @Pete.
Thanks for the Replay.
Actually I made a change in the line of code to:

img alt
And actually it works Thanks.