In my .NET C# project, I am trying to pass a color value from my C# code to an ASP.NET style class. The CSS for my class is as follows:
<style>
div.timeline-event {
color: #1A1A1A;
border-color: green;
background-color:#EFD5F6;
display: inline-block;
}
</style>
I attempted the following code to pass the values in a string:
MyBackgroundColor = "#EFD5F6";
In the Page load event, I have declared the variable above. However, when I try to pass it to the class, I am unsuccessful. How can I achieve this?