G
Guest
I am using a plain web forms button on an asp page - Is there any way to
programatically change it to a custom color?
programatically change it to a custom color?
Nicholas Paldino said:Rik,
Have you checked the style attribute for the button? You should be able
to set the backcolor style for the button to change the color of it.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Rik Brooks said:I am using a plain web forms button on an asp page - Is there any way to
programatically change it to a custom color?
--
Rik Brooks said:I tried
btn_active.Attributes["BackColor"] = "#C1E180";
but that gave me an error.
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the audience.
Animadverto est verus
Nicholas Paldino said:Rik,
Have you checked the style attribute for the button? You should be
able
to set the backcolor style for the button to change the color of it.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Rik Brooks said:I am using a plain web forms button on an asp page - Is there any way to
programatically change it to a custom color?
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the
audience.
Animadverto est verus
Nicholas Paldino said:Rik,
You have to set the style attribute to something like this:
bnt_active.Attributes["style"] = "background:#050505";
This causes the button to be rendered in HTML as:
<input type="button" style="background:#050505">
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Rik Brooks said:I tried
btn_active.Attributes["BackColor"] = "#C1E180";
but that gave me an error.
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the
audience.
Animadverto est verus
Nicholas Paldino said:Rik,
Have you checked the style attribute for the button? You should be
able
to set the backcolor style for the button to change the color of it.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
I am using a plain web forms button on an asp page - Is there any way
to
programatically change it to a custom color?
--
----------------------------------------
Magic is not in the hands of the magician but in the mind of the
audience.
Animadverto est verus
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.