C# textbox color
In a C# 2010 web app, I have a text box that I have disabled. I also want to make the backgound color gray. However I have not been able to find the code that will set the background color of a textbox to gray. Can you tell me how to accomplish this goal?
Posted Jun 21, 2012, 7:31 PM
For IE try the below code.
TextBox1.BackColor = Color.LightGray;
TextBox1.ReadOnly = true;
or
TextBox1.BackColor = Color.LightGray;
TextBox1.Enabled= false;
TextBox1.ForeColor = Color.Black;
Are you disabling the control in javascript then apply the CSS for the control ?
Look the below css class.
disabledtextbox" value="Disabled">