PC Review


Reply
Thread Tools Rating: Thread Rating: 2 votes, 1.00 average.

can I use this same Validation control to validate multiple textboxes?

 
 
Bibin
Guest
Posts: n/a
 
      16th Jul 2004
Dear All,

I am developing a POS application in ASP.Net. In my ASP.Net forms,
I may be having around 15 TextBox controls. I will need to validate these
controls
while editing.

I just want to know that, can we able to use a single validation control for
multiple
TestBox? Becaue some textboxes will be having validation of similar types.
So if
I am puting a "CustomValidationControl", can I use this same control to
validate
multiple textboxes?

What my intention is to avoid putting validation control for each and every
TextBoxes
to be validated.

If anybody tried this and got a solution, please do reply.

Thanks and Regads,

Bibin.


 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      16th Jul 2004
"Bibin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Dear All,
>
> I am developing a POS application in ASP.Net. In my ASP.Net forms,
> I may be having around 15 TextBox controls. I will need to validate these
> controls
> while editing.
>
> I just want to know that, can we able to use a single validation control

for
> multiple
> TestBox? Becaue some textboxes will be having validation of similar types.
> So if
> I am puting a "CustomValidationControl", can I use this same control to
> validate
> multiple textboxes?
>
> What my intention is to avoid putting validation control for each and

every
> TextBoxes
> to be validated.
>
> If anybody tried this and got a solution, please do reply.


Sorry, you need one per control to be validated. There is only the one
ControlToValidate property on each validation control.
--
John Saunders
johnwsaundersiii at hotmail


 
Reply With Quote
 
Bibin
Guest
Posts: n/a
 
      16th Jul 2004
Dear John,

Thanks for your reply. But there is a property called "ControlToValidate"
for these
validation controls. It can be setted in the runtime also. So can you please
tell me
how can we use this property in the runtime to validate multiple controls.

Thanks & Regards,

Bibin.


"John Saunders" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Bibin" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Dear All,
> >
> > I am developing a POS application in ASP.Net. In my ASP.Net forms,
> > I may be having around 15 TextBox controls. I will need to validate

these
> > controls
> > while editing.
> >
> > I just want to know that, can we able to use a single validation control

> for
> > multiple
> > TestBox? Becaue some textboxes will be having validation of similar

types.
> > So if
> > I am puting a "CustomValidationControl", can I use this same control to
> > validate
> > multiple textboxes?
> >
> > What my intention is to avoid putting validation control for each and

> every
> > TextBoxes
> > to be validated.
> >
> > If anybody tried this and got a solution, please do reply.

>
> Sorry, you need one per control to be validated. There is only the one
> ControlToValidate property on each validation control.
> --
> John Saunders
> johnwsaundersiii at hotmail
>
>



 
Reply With Quote
 
John Saunders
Guest
Posts: n/a
 
      16th Jul 2004
"Bibin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Dear John,
>
> Thanks for your reply. But there is a property called "ControlToValidate"
> for these
> validation controls. It can be setted in the runtime also. So can you

please
> tell me
> how can we use this property in the runtime to validate multiple controls.


ControlToValidate cannot be used that way. It indicates the one-and-only
control to be validated by this particular validation control.

Note that the validation controls all derive from the Label control. A
validation control is thus a smart label - one which will only be visible if
the validation has failed. As a result, you need one of these "labels" next
to each control to be validated.

Now, if you're trying to avoid dragging large numbers of validation
controls, you can try creating them at runtime. You can either create one
validation control per TextBox, or you could even create your own
ValidatedTextBox control which would have both the TextBox and the
corresponding validation controls in it. You would then be able to drag
ValidatedTextBox controls onto your form. You could even get fancier and add
a label in front of the TextBox, all in one control.

You might want to take a look at the following: Developing a Composite
Control
(http://msdn.microsoft.com/library/de...-us/cpguide/ht
ml/cpcondevelopingcompositecontrols.asp). Composite controls can be very
easy to develop, since most of the work is done in the controls out of which
the composite is formed.
--
John Saunders
johnwsaundersiii at hotmail


> "John Saunders" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > "Bibin" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Dear All,
> > >
> > > I am developing a POS application in ASP.Net. In my ASP.Net forms,
> > > I may be having around 15 TextBox controls. I will need to validate

> these
> > > controls
> > > while editing.
> > >
> > > I just want to know that, can we able to use a single validation

control
> > for
> > > multiple
> > > TestBox? Becaue some textboxes will be having validation of similar

> types.
> > > So if
> > > I am puting a "CustomValidationControl", can I use this same control

to
> > > validate
> > > multiple textboxes?
> > >
> > > What my intention is to avoid putting validation control for each and

> > every
> > > TextBoxes
> > > to be validated.
> > >
> > > If anybody tried this and got a solution, please do reply.

> >
> > Sorry, you need one per control to be validated. There is only the one
> > ControlToValidate property on each validation control.
> > --
> > John Saunders
> > johnwsaundersiii at hotmail
> >
> >

>
>



 
Reply With Quote
 
Teemu Keiski
Guest
Posts: n/a
 
      22nd Jul 2004
Hi,

CustomValidator can do that if you mean one controls instance on Page . You
just leave ControlToValidate blank when the validator isn't specified for
one certain control (this works only for CustomValidator). You still need to
reference the controls to be validated in validation functions, but that's
another thing.

Here is info about ASp.NET Validation:
http://msdn.microsoft.com/library/de...pplusvalid.asp

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke



"Bibin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Dear All,
>
> I am developing a POS application in ASP.Net. In my ASP.Net forms,
> I may be having around 15 TextBox controls. I will need to validate these
> controls
> while editing.
>
> I just want to know that, can we able to use a single validation control

for
> multiple
> TestBox? Becaue some textboxes will be having validation of similar types.
> So if
> I am puting a "CustomValidationControl", can I use this same control to
> validate
> multiple textboxes?
>
> What my intention is to avoid putting validation control for each and

every
> TextBoxes
> to be validated.
>
> If anybody tried this and got a solution, please do reply.
>
> Thanks and Regads,
>
> Bibin.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Validate Textboxes Craig Coope Microsoft Excel Discussion 1 26th Mar 2007 01:10 PM
Validate between 2 textboxes light of mind. heavy of belly Microsoft ASP .NET 5 3rd Jun 2006 05:28 PM
How to: Use "custom validation" control to validate Calendar Contr =?Utf-8?B?Y2hhcmxpZXdlc3Q=?= Microsoft C# .NET 1 11th Feb 2005 04:22 PM
Q: validate many textboxes =?Utf-8?B?SklNLkgu?= Microsoft ASP .NET 2 25th Dec 2004 05:26 PM
Can one validation control work for multiple textboxes? Russ Microsoft ASP .NET 3 4th Dec 2003 10:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:48 PM.