Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

default border color for .net textbox

Tags:

asp.net

I change the border style and border color on a .net textbox to solid red respectively. After a postback I am attempting to return the textbox to its default values, but I cannot seem to get the color right. I have googled this, and tried to get the default values in the debugger, but the values in the debugger always look too dark of a gray when applied. Is there an easy way to return to the default look and feel of a textbox?

like image 857
mike Avatar asked Aug 02 '10 21:08

mike


3 Answers

try this:

TextBoxTitle.BorderColor = System.Drawing.Color.Empty;
like image 70
Lars A. Avatar answered Oct 19 '22 23:10

Lars A.


You can write two CSS classes:

.tb_with_border {
 border: 1px #FF0000 solid;
}

.tb_without_border {
 border: none;
}

.. and then you can change styles by assigning CssClass property of your textbox, for example:

Textbox1.CssClass = "tb_without_border";

or in markup:

<asp:TextBox id="Textbox1" runat="server" CssClass="tb_with_border" />
like image 41
Pavel Morshenyuk Avatar answered Oct 19 '22 22:10

Pavel Morshenyuk


If you're just switching the particular element style off then this works:

Textbox1.BorderColor = Nothing
like image 43
Nick Warner Avatar answered Oct 19 '22 21:10

Nick Warner