954,580 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

ASP.NET button backcolor changing from code.

Hi everybody,
I got one problem in ASP.NET.
i want to change button backcolor from code.
btn_save.bachgroundcolor=system.drawing.color.red
the above code is working fine.
But instead of "system.drawing.color.red" , i want to give #123234 or rgb() format.
i cant give
btn_save.bachgroundcolor=#23534
btn_save.bachgroundcolor=rgb(0,0,0)
I will give error as invalid return type is integer.

Can u plz tell me.
Thank you
Regards
Roopa Raj

rooparaj
Newbie Poster
8 posts since Jan 2005
Reputation Points: 10
Solved Threads: 0
 

Try looking at :
LINK 1 - Button Changes

LINK 2 - Tab Control

You normal would change this using CSS , as VB script/code is the code for the business logic of the application. HTML is the layout code for the ASP.Net Page, and CSS would be used for styling the page(s).

Hope this helps
Hi everybody,
I got one problem in ASP.NET.
i want to change button backcolor from code.
btn_save.bachgroundcolor=system.drawing.color.red
the above code is working fine.
But instead of "system.drawing.color.red" , i want to give #123234 or rgb() format.
i cant give
btn_save.bachgroundcolor=#23534
btn_save.bachgroundcolor=rgb(0,0,0)
I will give error as invalid return type is integer.

Can u plz tell me.
Thank you
Regards
Roopa Raj

Paladine
Master Poster
Team Colleague
824 posts since Feb 2003
Reputation Points: 211
Solved Threads: 27
 

hi raj ,
try this

btn1 .BackColor = System.Drawing.ColorTranslator.FromHtml("#FFFF00");
sreenivas.varma
Newbie Poster
1 post since Jan 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You