views:

28

answers:

2

i have a dropdown list and text box. i disabled both controls using code behind. now, at one sight we can understand the dropdown list is disabled , because the background color of drop down list is changed automatically.

i want to make that same background color to the text box control too. But i dont know what color code is that. i am working in asp.net . Any suggestions??

+1  A: 

Try this

 <asp:TextBox ID="txtCDate" runat="server" CssClass="textbox"  BackColor="#efefef" />
Vishnu K B
+1  A: 

Actually, the "disabled" color may vary depending on the browser ... AFAIK, Firefox would put in a grey background to a disabled input box, and you could customize this behaviour via css with a selector like

input[disabled='disabled'] {
  ... styles go here ...
}

The problem is probably IE-specific, and in that case, this CSS selector would not work... You would probably need to add a specific CSS class to the disabled element to have more control over its look.

You could check this article about this issue : Shawn asks the CSS Guy about styling disabled text inputs

tsimbalar