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!

Controlling Validation Error Message Display

You can display error message text:

You also have options for specifying the format and layout of error messages. For details, see Formatting Validation Error Messages.

If you want to display summarized or pop-up error messages, you need to add a control to the page.

To add summarized error messages

  1. Add a ValidationSummary control to the page at the location where you want to display the collected error messages.
  2. Set the summary control's DisplayMode property to format the error messages, using one of the following values defined in the ValidationSummaryDisplayMode enumeration:
    • BulletList   Each message appears in a bullet list. (This is the default.)
    • List   Each messages appears on its own line.
    • SingleParagraph   Each message appears as a sentence in a paragraph.
  3. Optionally set the control's HeaderText property to provide a title or header for the error messages.

Choosing inline and summary display involves setting different combinations of properties in the individual validation controls.

To choose in-line and summary error display

  1. If you want to display summary errors, add a ValidationSummary control as described in the procedure above.
  2. Set the ErrorMessage, Text, and ValidatorDisplay properties of the individual validation controls according to the following table:
    Option ValidationSummary control required? Property settings on validation control
    Inline only no ValidatorDisplay = VisibleStaticLayout or
    VisibleDynamicLayout

    ErrorMessage = (error text)

    Summary only (including optional pop-up ) yes ValidatorDisplay = NeverVisible

    ErrorMessage = (error text)

    Inline and summary (including optional pop-up) yes ValidatorDisplay = VisibleStaticLayout or
    VisibleDynamicLayout

    ErrorMessage = (error text for summary)

    Text = (in-line error text)

If the user is working with a DHTML-compatible browser such as Internet Explorer 4.0 or later, summarized error messages can also appear in a pop-up window.

To display summarized error messages in a pop-up window

See Also

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