RequiredField Validator options

  • Thread starter Thread starter MattB
  • Start date Start date
M

MattB

I have a form that uses a bunch of required field validators. I want to
have an option to pre-populate the fields based on a lookup on the same
page. My problem is that the validators prevent me from submitting the form
for the lookup.
What I think I need to do is somehow make the validators only apply to
one button instead of any button on the page. Is there a way to achieve this
either through a change to the button or to the validators? Thanks!

Matt
 
Each button that posts back to a page (either an Image Button, standard
Button, or Link Button) has a "CausesValidation" property that you can set
to false if you don't want that specific button's post-back event to
validate the page.

HTH,
-Cliff
 
Perfect. Thanks!

Cliff said:
Each button that posts back to a page (either an Image Button,
standard Button, or Link Button) has a "CausesValidation" property
that you can set to false if you don't want that specific button's
post-back event to validate the page.

HTH,
-Cliff
 
Hi Matt,

First off...great name!

The answer is very simplistic...you'll need to set CausesValidation=False on the button that is causing the postback to retrieve the data.

Matt Hawley, MCAD .NET http://www.eworldui.net I have a form that uses a bunch of required field validators. I want to
have an option to pre-populate the fields based on a lookup on the same
page. My problem is that the validators prevent me from submitting the form
for the lookup.
What I think I need to do is somehow make the validators only apply to
one button instead of any button on the page. Is there a way to achieve this
either through a change to the button or to the validators? Thanks!

Matt



[microsoft.public.dotnet.framework.aspnet]
 
Back
Top