944,033 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 32262
  • ASP.NET RSS
Mar 21st, 2005
0

ASP.NET button backcolor changing from code.

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rooparaj is offline Offline
8 posts
since Jan 2005
Mar 23rd, 2005
0

Re: ASP.NET button backcolor changing from code.

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
Quote originally posted by rooparaj ...
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
Team Colleague
Reputation Points: 211
Solved Threads: 27
Master Poster
Paladine is offline Offline
793 posts
since Feb 2003
Jan 16th, 2009
0

Re: ASP.NET button backcolor changing from code.

hi raj ,
try this
ASP.NET Syntax (Toggle Plain Text)
  1. btn1 .BackColor = System.Drawing.ColorTranslator.FromHtml("#FFFF00");
Last edited by peter_budo; Jan 18th, 2009 at 2:29 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sreenivas.varma is offline Offline
1 posts
since Jan 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Report rebuilding error with microsoft vs 2003
Next Thread in ASP.NET Forum Timeline: Pull XMl with attributes data in a datagrid





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC