Tuesday 1 January 2013

Forecolor in asp Text Box


TextBox1.ForeColor = Color.Red;
TextBox1.Font.Bold = True;


Or this can be done using a CssClass (recommended):

.highlight
{
  color:red;
  font-weight:bold;
}

codebehind
TextBox1.CssClass = "highlight";
or,Design source
<asp:TextBox id="TextBox1" runat="server" CssClass="highlight"></asp:TextBox>

Or the styles can be added inline:

TextBox1.Attributes["style"] = "color:red; font-weight:bold;";

No comments:

Post a Comment

If any doubt?then please comment in my post

How to reduce angular CLI build time

 Index: ----- I am using angular cli - 7 and I am going to tell how to reduce the build time as per my knowledge. Problem: -------- Now the ...