Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Trigger a Subset of Multiple Validators (Client-Side)

Reply
Thread Tools

Trigger a Subset of Multiple Validators (Client-Side)

 
 
Jordan S.
Guest
Posts: n/a
 
      05-16-2008
I'm experimenting with dynamically inserting custom composite Web server
controls onto a page. For testing purposes I have two custom composite Web
server controls that each have a couple of TextBox controls and a "submit"
button, as well as required field validators for each of the textboxes.

What I'm finding is that when both of these Web server controls appearon the
page, clicking on the "submit" button of either of the controls causes
validation of *both* Web server controls' TextBox controls.

Just wondering:
1. Is this by design?... that ASP.NET would cause all client-side validators
to run whenever any Submit button is clicked?

2. Is there any way to trigger the client-side validators for ONLY the
custom Web Server control to which the validators are explicitly tied?

I understand that we can set a .CausesValidation property to be False - but
that setting applies for all time. What I'd like is some way to have
client-side validation happen for one set of controls when one Submit button
is clicked; but when a different Submit button is clicked validate a
completely different set of controls.

Thanks.



 
Reply With Quote
 
 
 
 
Misbah Arefin
Guest
Posts: n/a
 
      05-16-2008
"Jordan S." <(E-Mail Removed)> wrote in message
news:O3UK$(E-Mail Removed)...
> I'm experimenting with dynamically inserting custom composite Web server
> controls onto a page. For testing purposes I have two custom composite Web
> server controls that each have a couple of TextBox controls and a "submit"
> button, as well as required field validators for each of the textboxes.
>
> What I'm finding is that when both of these Web server controls appearon
> the page, clicking on the "submit" button of either of the controls causes
> validation of *both* Web server controls' TextBox controls.
>
> Just wondering:
> 1. Is this by design?... that ASP.NET would cause all client-side
> validators to run whenever any Submit button is clicked?


if you are using .NET 1.1 then yes this is by design but you can work around
it by using a CustomValidator

> 2. Is there any way to trigger the client-side validators for ONLY the
> custom Web Server control to which the validators are explicitly tied?


in .NET 2.0 you set the ValidationGroup property of the validator controls
and the submit button. when the submit button is clicked only the validator
controls in the same ValidationGroup will be checked

>
> I understand that we can set a .CausesValidation property to be False -
> but that setting applies for all time. What I'd like is some way to have
> client-side validation happen for one set of controls when one Submit
> button is clicked; but when a different Submit button is clicked validate
> a completely different set of controls.
>
> Thanks.
>


--
Misbah Arefin
https://mcp.support.microsoft.com/profile/MISBAH.AREFIN
http://dotnethitman.spaces.live.com
http://www.linkedin.com/in/misbaharefin


 
Reply With Quote
 
 
 
 
Jordan S.
Guest
Posts: n/a
 
      05-16-2008
Very good. Thank you! I'm using .NET 3.5, so the ValidationGroup property is
apparently what I'm needing.

-J


"Misbah Arefin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Jordan S." <(E-Mail Removed)> wrote in message
> news:O3UK$(E-Mail Removed)...
>> I'm experimenting with dynamically inserting custom composite Web server
>> controls onto a page. For testing purposes I have two custom composite
>> Web server controls that each have a couple of TextBox controls and a
>> "submit" button, as well as required field validators for each of the
>> textboxes.
>>
>> What I'm finding is that when both of these Web server controls appearon
>> the page, clicking on the "submit" button of either of the controls
>> causes validation of *both* Web server controls' TextBox controls.
>>
>> Just wondering:
>> 1. Is this by design?... that ASP.NET would cause all client-side
>> validators to run whenever any Submit button is clicked?

>
> if you are using .NET 1.1 then yes this is by design but you can work
> around it by using a CustomValidator
>
>> 2. Is there any way to trigger the client-side validators for ONLY the
>> custom Web Server control to which the validators are explicitly tied?

>
> in .NET 2.0 you set the ValidationGroup property of the validator controls
> and the submit button. when the submit button is clicked only the
> validator controls in the same ValidationGroup will be checked
>
>>
>> I understand that we can set a .CausesValidation property to be False -
>> but that setting applies for all time. What I'd like is some way to have
>> client-side validation happen for one set of controls when one Submit
>> button is clicked; but when a different Submit button is clicked validate
>> a completely different set of controls.
>>
>> Thanks.
>>

>
> --
> Misbah Arefin
> https://mcp.support.microsoft.com/profile/MISBAH.AREFIN
> http://dotnethitman.spaces.live.com
> http://www.linkedin.com/in/misbaharefin
>
>
>




 
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
Multiple Validators against a control epigram ASP .Net 1 04-05-2005 07:51 PM
Multiple Validators printing multiple messages tshad ASP .Net 2 01-27-2005 06:19 PM
Regular Expression validators NOT working, Required Field validators ARE working Ratman ASP .Net 0 09-14-2004 09:36 PM
Multiple validators fire at the same time =?Utf-8?B?QW5kZXJzQmo=?= ASP .Net 2 08-27-2004 09:37 AM
validators subset news.microsoft.com ASP .Net 1 05-27-2004 10:28 PM



Advertisments