Validation Probs

  • Thread starter Thread starter Mukesh
  • Start date Start date
M

Mukesh

Currently i am developing a web application using asp.net1.1. I have
developed several user control for this application . I am using
validator in such user control.

My problem is that whenever I use two controls ( both having required
field validator )together on a single page. The required field validator
validator creates problems . They interferes each others area. n shows
me an err.

Plz help me

Mukesh Agarwal
 
Hi Mukesh,

Welcome to the MSDN newsgroup.

As for the ASP.NET validation controls, in 1.x, the validation is based on
page scope, that means when the page get validation fired, it'll call all
the validators on the page to do the validation no matter whether those
validators are separated in different Usercontrol or not. For 2.0, ASP.NET
provide validationGroup feature which may help resolve the problem.
Currently for 1.x, I know that there're some 3rd party validation controls
provide this feature. If you do want to implement it through built-in
validation controls, you can consider programmatically invoke the
validation control's valiate method (at client-side or server-side), here
is a good msdn article describing the ASP.NET validation control's model:

#ASP.NET Validation in Depth
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html
/aspplusvalid.asp

Also, you can consider encapsulating the valiation logic into your own
custom control instead of using the built-in validators.

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Back
Top