NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Formatting Validation Error Messages

You can control the format — font, size, and so on — of error message text, or you can substitute a glyph for error text. Validation controls support the same properties as other controls for specifying their look.

To format error messages

You can provide formatting within an error message by using HTML elements in the text for the ErrorMessage and Text properties. For example, to apply italics to only one word in the error message, you can surround the word with <I> and </I> tags.

Note   To display reserved HTML characters within the error message text, encode them. For example, to display "<", use the character sequence &lt;.

If you are displaying validation errors in a summary, you can specify that a glyph appear in place of the individual validation control.

To display glyphs next to input controls

  1. Set the ErrorMessage property of each validation control to the error text that should appear in the ValidationSummary control.
  2. Set the Text property of each validation control to the glyph to display. The glyph can consist of any valid HTML, including text (such as an asterisk) and an image element.
    Note   The glyph is displayed in place of the validation control. It's up to you to lay out the validation control in such a way that the glyph displays properly.

See Also

Validation Controls | Introduction to Validating User Input in Web Forms |