This documentation is archived and is not being maintained.

ValidationSummary.ForeColor Property

Gets or sets the fore color of the control.

[Visual Basic]
Overrides Public Property ForeColor As Color
[C#]
public override Color ForeColor {get; set;}
[C++]
public: __property Color get_ForeColor();
public: __property void set_ForeColor(Color);
[JScript]
public override function get ForeColor() : Color;
public override function set ForeColor(Color);

Property Value

A System.Drawing.Color that represents the fore color of the control. The default is Red.

Remarks

Use this property to specify the color in which error messages from validation controls are displayed.

Example

[Visual Basic, C#] The following example demonstrates how to use the ForeColor property to specify that the validation summary is displayed with blue text.

[Visual Basic] 

 <asp:ValidationSummary 
      id="valSum" 
      DisplayMode="BulletList"
      ForeColor="Blue" 
      HeaderText="You must enter a value in the following fields:"
      Font-Name="verdana" 
      Font-Size="12"
      runat="server"/>
 

[C#] 

 <asp:ValidationSummary 
      id="valSum" 
      DisplayMode="BulletList"
      ForeColor="Blue" 
      HeaderText="You must enter a value in the following fields:"
      Font-Name="verdana" 
      Font-Size="12"
      runat="server"/>
 

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

ValidationSummary Class | ValidationSummary Members | System.Web.UI.WebControls Namespace | System.Drawing.Color

Show: