Solved

Set Textbox Background color ASP.NET 2.0

Posted on 2011-09-28
3
456 Views
Last Modified: 2012-05-12
Hello Experts,

I have a simple task, I'm changing the background color of the textbox on condition. If my condition fails , I need set the default text background color for the text box.

How can I get that, while debugging I seen the textbox properties. It shows:

"{Name=0, ARGB=(0, 0, 0, 0)}".

Whether I can set this value to textbox property and get the default background color.
0
Comment
Question by:ASPDEV
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 500 total points
ID: 36718192
You should be able to set the background color simply like :

txtLastName.BackColor = System.Drawing.Color.White
0
 
LVL 12

Expert Comment

by:Ramkisan Jagtap
ID: 36718408
add style to that page
<style>
#input{ background: ur color;}
</style}
0
 

Author Closing Comment

by:ASPDEV
ID: 36718421
Thanks.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question