Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking background of server control in aspx page

Status
Not open for further replies.

sodakotahusker

Programmer
Mar 15, 2001
601
I want to check on the color between <% %> tags in my aspx page to see if the color is red or not.

I printed out the value of the color and got
Color [A=255, R=0, G=102, B=204]

however I can not use the <> with a system.color property and also can't convert that value to a string. It does not recognize = color.red either or system.drawing.color.red

<% if statuslabel.backcolor <> "Color [A=255, R=0, G=102, B=204]" then
dosomething
end if

Here is one of the errors :
BC30452: Operator '<>' is not defined for types 'System.Drawing.Color' and 'System.Drawing.Color'.



How can I do this?
 
Try
Code:
statuslabel.BackColor.ToArgb = Color.FromArgb(255, 0, 102, 204).ToArgb

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top