473,386 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

seeing if a control isValid

I'm stuck on some syntax. I'm building my own summary validator. I'm walking
through the controls to see which ones are validator controls. Then, for
each one that is, I want to check the isValid state:

if instr(child.GetType.ToString(), "validator") then
*check validity
End If

The problem is that I'm stuck on how to check the particular webcontrol to
see if it isValid

I can obviously grab the object and check:

RequiredFieldValidator_email.isvalid
but since I'm walking through each webControl, I need a way to check the
current control. Something like this:
if theCurrentControl.isValid then

But I'm totally stuck on the syntax for this.

-Darrel
Nov 18 '05 #1
2 1637
This might help you:

If (TypeOf child Is BaseValidator) Then
child.Validate()
If (Not child.IsValid) Then
' Get the error message...
End If
End If

"darrel" <no*****@hotmail.com> wrote in message
news:#j**************@TK2MSFTNGP12.phx.gbl...
I'm stuck on some syntax. I'm building my own summary validator. I'm walking
through the controls to see which ones are validator controls. Then, for
each one that is, I want to check the isValid state:

if instr(child.GetType.ToString(), "validator") then
*check validity
End If

The problem is that I'm stuck on how to check the particular webcontrol to
see if it isValid

I can obviously grab the object and check:

RequiredFieldValidator_email.isvalid
but since I'm walking through each webControl, I need a way to check the
current control. Something like this:
if theCurrentControl.isValid then

But I'm totally stuck on the syntax for this.

-Darrel

Nov 18 '05 #2
Anyone? I'm having a really hard time finding an answer to this issue.
I'm stuck on some syntax. I'm building my own summary validator. I'm walking through the controls to see which ones are validator controls. Then, for
each one that is, I want to check the isValid state:

if instr(child.GetType.ToString(), "validator") then
*check validity
End If

The problem is that I'm stuck on how to check the particular webcontrol to
see if it isValid

I can obviously grab the object and check:

RequiredFieldValidator_email.isvalid
but since I'm walking through each webControl, I need a way to check the
current control. Something like this:
if theCurrentControl.isValid then

But I'm totally stuck on the syntax for this.

-Darrel

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sarah Katon | last post by:
Hi all. I'm fairly new to VB.net, and I have very little experience with Javascript. I'm trying to get a Client Side Custom Validator to work for many interrelated controls. I'd like to check...
2
by: Salim Afþar | last post by:
Hi, Is it possible to control a textbox with NUMERIC value with regularexpressionvalidator. Thanks in advance, Salim
1
by: Sunil Sabir | last post by:
Dear All, I want to use a Custom Validator Control on a Text box which accepts only characters values. I am using the follwing procedure: Sub CustomValidator_ServerValidate(ByVal s As...
4
by: owingruters | last post by:
Hi all, I've created an User control. It's an extension of a textbox wich has some extra properties so that validation becomes a lot faster. The control wordks great if autopostback is on....
3
by: Simon Harvey | last post by:
Hi All Is there anyway to check the IsValid property in a user control? I've made a user control that holds a number of validators. There are also event handlers in the control that handle...
1
by: Joey | last post by:
Does anyone know how to validate only one certain control in server side code on postback? Instead of Page.Validate() and Page.IsValid, is there some functionality equivalent to...
4
by: AG | last post by:
ASP.NET 1.1 app. Can anyone point me to a sample of how to require entry into either of two textboxes? TIA -- AG Email: discuss at adhdata dot com
1
by: settyv | last post by:
Hi, I need to use customvalidator control for calculating datedifference and need to alert if fromdate is greater than todate.Please let me know how can i do that using this control in asp.net....
0
by: Arti | last post by:
Hi, I am using ASP.NET 2.0 ; Windows XP SP3 machine. In my web page i have made use of twocustom validator controls. Say, cv1 and cv2 Programatically - cv1_ServerValidate(object source,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.