views:

123

answers:

2

I have two custom validators that are in the same validation group. This validation group is launched by one button. My question is, in what order will the custom validators fire in? It appears that the validator that is placed earlier in the aspx page fires first, but I don't want to rely solely on this. Any thoughts?

A: 

I would not rely on this. I would assume any order as this is implementation dependent. It may later change if your server has multiple processors or if you run it on Mono, for example.

Jason Kealey
What characteristics suggest it is implementation-dependent?
Rex M
To me, the concept of validators suggest no order of priority; although I appear to be wrong today, I would not be surprised if this assumption changed in the long run.
Jason Kealey
+1  A: 

They will fire in the order they exist in the control tree, since the page lifecycle events recurse down that tree from the top. The validation event is, in turn, fired from a lifecycle event.

Rex M
+1 They will fire in the order you listed them.
Chris Ballance