开发者

Validation summary without other validations

开发者 https://www.devze.com 2023-03-17 02:53 出处:网络
I would like to display the summary of validation in a validation summary with out displaying them in invidual validator means i would like to show only errors in Valida开发者_如何转开发tion summary i

I would like to display the summary of validation in a validation summary with out displaying them in invidual validator means i would like to show only errors in Valida开发者_如何转开发tion summary i don't want to show in any


Set display="none" on your validation controls. This will hide the validation text for the individual validation controls.

Then give them all a validation group linked to a ValidationSummary


An alternative solution is to use both ErrorMessage and Text properties of the Validator controls.

  1. Give your Validator controls, post back controls (Buttons, posting Dropdowns etc.) and ValidationSummary control the same ValidationGroup value.
  2. Set * on Text property for your Validators.
  3. Set the value you want to display on ValidationSummary for each of your Validators to ErrorMessage property.

This way you will have your validation descriptions (ErrorMessage) displayed at ValidationSummary control and a * (Text) displayed next to controls that failed validation.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号