How do I modify the default behavior of required fields on my form, particularly the message displayed in the alert box when trying to submit the form?

The message The field {0} is required (where {0} is the tooltip that was set on the validated control) is the default text displayed to end-users when submitting the form without providing a response to a required control.

If no tooltip was found, the ID of the control will be used. The ID of the control will usually not be appropriate to display to end-users, so we strongly recommend assigning a value to the tooltip property for all required controls on your form. If you want to have a personalized message, you have to change the RequiredFieldsErrorMessage property. Be sure to the include {0} symbol in your personalized message, otherwise WorkflowGen will throw an exception.

Example

In the Page_Load event of your web form, provide the following line of C# code:

this.RequiredFieldsErrorMessage = "{0} is a required field. Please provide a response.";

You can also modify the default border color of required controls. While the default color is red, you can change the color to blue with the following line of code:

this.RequiredFieldsBorderColor = System.Drawing.Color.Blue;