Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > BaseValidator Inherited Ctrl Not working with RequiredFieldValidator

Reply
Thread Tools

BaseValidator Inherited Ctrl Not working with RequiredFieldValidator

 
 
James
Guest
Posts: n/a
 
      10-16-2005
Hi All,

I have written a control that inherits BaseValidator. If it used by
itself on a page, the control works perfectly fine.

If I drop the RequiredFieldValidator on the same page to evaluate a
different textbox, my control does not work. But *only* if
RequiredFieldValidator does not pass.

It seems like when RequiredFieldValidator raises False, it shuts
everything else off.

I placed a breakpoint in my control, and it doesn't even go into it.

Any suggestions are greatly appreciated!

Thanks!!
James

 
Reply With Quote
 
 
 
 
James
Guest
Posts: n/a
 
      10-16-2005
Well, after I placed this post, I tried changing "Enable Client Script"
to FALSE on the RequiredFieldValidator control.

This allowed my control to work properly!

I'm not using client side scripting, so this not an issue. But it
would seem strange that this would have to be the case.

Perhaps somebody could explain why this would need to be done?

Thanks!
James

 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      12-04-2005
Hi,

at client if RequiredFieldValidator fails, that already prevents the page
from posting back (since one of the validators indicates error).

It is so that if your control has no input/selection whatsoever,
RequiredFieldValidator is the one catching that, and no other validators
will be yet invoked (e.g by default no other validator than RFV is applied
for empty input). Then if there is some input, RFV will pass validation, and
other, more specialized validators kick in, like check the correctness of
the given input, as the input now exists.

Mechanically it happens so that if validation control is passed empty input
value, it returns true as outcome of the validation. This way, it's left up
to the RFV in the first place to check for empty inputs.

You can tweak this behaviour with custom validators / 3rd party validator
controls & components (Professional Validation And More for instance)

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke


"James" <> wrote in message
news: oups.com...
> Well, after I placed this post, I tried changing "Enable Client Script"
> to FALSE on the RequiredFieldValidator control.
>
> This allowed my control to work properly!
>
> I'm not using client side scripting, so this not an issue. But it
> would seem strange that this would have to be the case.
>
> Perhaps somebody could explain why this would need to be done?
>
> Thanks!
> James
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The richtextbox not receiving the keys such Ctrl+A, Ctrl+O when typedon it when hosted on web page Gouri.Mahajan7@gmail.com ASP .Net 0 07-11-2008 05:27 AM
Disabling the shortcuts such as Ctrl+A, Ctrl+B.... using Javascript Gouri.Mahajan7@gmail.com ASP .Net 2 07-10-2008 08:15 AM
How to intercept Ctrl key - eg Ctrl E being pressed on Java console program Angus Java 5 11-18-2006 04:19 PM
Implement Ctrl-C, Ctrl-V Danny C++ 5 08-15-2003 03:04 AM
Implement Ctrl-C, Ctrl-V Danny C Programming 5 08-15-2003 03:04 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57