Validators in version 1.1

  • Thread starter Thread starter Bill Richardson
  • Start date Start date
B

Bill Richardson

We have a technique for our order process whereby we
simply turn panels on and off to capture data for the
various stages, rather than the normal method of moving
between pages.

In 1.0, the validators were not being fired if they were
in a panel whose visibility was set to false. However, in
1.1, it appears that ALL validators fire on validation,
regardless of whether the panel is visible or not. This
is causing all sorts of problems, not the least of which
is that the page.IsValid is always false now, as we
obviously don't capture ALL data at once... so the
required validators fail.

Has anyone seen this, and more importantly, is there a fix
for it? Any help is greatly appreciated!

Bill Richardson
Senior Software Engineer
Proflowers.com
 
Bill,

I've seen it too. I don't know if this is by design or not. Perhaps someone
else could enlighten us with that information. You may need to resort to
setting each panel's validators to disabled as you move between panels :(

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
Well... at least I'm not going nuts. I'm seeing this on
Windows 2003... are you on 2003, or WIN2K?
 
Was he talking about the .Visible property or the style display property?
It sounds to me like they fixed a bug in 1.1. Why should a validator care
about whether there's a style="DISPLAY: none" on some tag it's contained
in?
 
Now that's a damn good question. If a panel set ".Visible=False" is rendered
at all, including its child controls, then that's real big news to me!
 
No, of course it's child controls are not rendered. anyway, validators
really aren't rendered, but perhaps their registration w/ the page is taking
outside of the render method and, therefore whether or not the render is
called on the control is inconsequential.

The page has a .Validators collection and the .IsValid property of
IValidator is writable. You could set the instance .IsValid property to
true if it it's it's parent placeholder .Visible is false. IF this is
indeed a bug in .net.
 
Bill,

For right now we're still on windows 2000 advanced server. We'll be
switching to windows 2003 server soon, but I don't expect that to change the
way the framework is handling this... Then again... :)

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
A good experiment for someone with access to both 1.0 and 1.1 would be to
try this validators-in-panels trick with one visible and one not, and to try
it on both, and to review the generated HTML in both versions. Simplest page
only, please. Just a textbox and RequiredFieldValidator per panel.

Enquiring minds without easy access to 1.1 want to know...
 
Back
Top