ASP.NET ForeColor Property

Definition and Usage

The ForeColor property is used to set or return the foreground color of the control (usually the text color).

Syntax

<asp:webcontrol id="id" ForeColor="color" runat="server" />
Property Description
color Set the color for the control's foreground color. It must be a valid HTML Colors.

Example

The following example sets the foreground color of the button:

<form runat="server">
<asp:Button id="button1" Text="Submit" 
ForeColor="#FF0000" runat="server" />
</form>

Example

Set the ForeColor of Button Control
Set the ForeColor of Button Control (with declaration and script)