Hello,
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:
<
input
id
=
"someID"
class
=
"there is some information here"
tabindex
=
"-32767"
title
=
"title"
style
=
"background-color: rgb(255, 50, 50); border-width: 2px; border-style: inset; border-image: none;"
type
=
"text"
>
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 = <
the
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
help,
tsjax