I am trying to do
something seemingly simple and that is to get the background color of a
particular element in order to validate whether or not it is correct based on
the business rules. The element in questions follows this configuration:
"there is some information here"
"background-color: rgb(255, 50, 50); border-width: 2px; border-style: inset; border-image: none;"
I am not having any
trouble accessing the element and its various attributes. However, regarding
the style 'background-color', I get into trouble:
HtmlInputText el = <
element referenced above>;
var bgColor = el.GetStyle("background-color"); // <---- Throws an exception (Invalid Operation Exception).
The problem is the style, "background-color" very clearly exists as you can see in bold above.
However, I cannot figure out a reliable and elegant way to pull it out and get
its value. Perhaps my approach to this problem is going down the wrong track?
Thanks for your