Re: IValidator - multiple error messages
From: Peter Blum (PLBlum_at_Blum.info)
Date: 12/07/04
- Next message: jim: "Reset on Style Property does not change design View"
- Previous message: Ashish Kaila: "Re: Dropdownlist is not covered by my menu even if its z-index is higher"
- In reply to: Peter Morris [Air Software Ltd]: "IValidator - multiple error messages"
- Next in thread: Peter Morris [Air Software Ltd]: "Re: IValidator - multiple error messages"
- Reply: Peter Morris [Air Software Ltd]: "Re: IValidator - multiple error messages"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 7 Dec 2004 11:13:35 -0500
Hi Pete,
A big focus of my business is data entry validation on webforms. So I have
some knowledge of the issues you raise.
* You can certainly write out a single string, containing all of your error
messages. There are two ways. Use a Label that you assign the text and make
visible when there is an error. Use a CustomValidator and within the
"evaluation function" that you write, you do all that validation and assign
the ErrorMessage property.
* There are formatting challenges when you have lengthy strings displayed in
the web form. Often users like to delegate a lengthy list of error messages
to the ValidationSummary control which groups them together and shows them
as a list.
* The ValidationSummary control is designed for single validation errors so
that it's formatting rules can build separate lines for each error found.
* Recommendation: Use the ValidationSummary control. Add a PlaceHolder
control somewhere to the page. For each error message that you get back,
create a CustomValidator object with its ErrorMessage assigned and its
Display property set to None. Set it to an "evaluation function" that simply
evaluates as "invalid". This way, you are creating a list of error messages
on the fly that will appear in the ValidationSummary.
--- Peter Blum
www.PeterBlum.com
Email: PLBlum@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
"Peter Morris [Air Software Ltd]" <peter.morris@guess.co.uk> wrote in
message news:eh4zzaF3EHA.3376@TK2MSFTNGP12.phx.gbl...
> Hi all
>
> I want a validator which
> A) Doesn't validate a control
> B) Is able to report more than one error
>
> The reason for this is that I am validating a whole business object based
> on a list of expressions, rather than individual controls.
>
> Is it possible to do this? Could someone please tell me how, because I
> can only see IValidator and the ability to add a single error from my
> single class (I don't want to use multiple validators).
>
> Thanks
>
>
> --
> Pete
> ====
> Audio compression components, DIB graphics controls, FastStrings
> http://www.droopyeyes.com
>
> Read or write articles on just about anything
> http://www.HowToDoThings.com
>
> My blog
> http://blogs.slcdug.org/petermorris/
>
- Next message: jim: "Reset on Style Property does not change design View"
- Previous message: Ashish Kaila: "Re: Dropdownlist is not covered by my menu even if its z-index is higher"
- In reply to: Peter Morris [Air Software Ltd]: "IValidator - multiple error messages"
- Next in thread: Peter Morris [Air Software Ltd]: "Re: IValidator - multiple error messages"
- Reply: Peter Morris [Air Software Ltd]: "Re: IValidator - multiple error messages"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|