Selective Validation Using Validator Controls

  • Thread starter Thread starter Bobby Maul
  • Start date Start date
B

Bobby Maul

I'm not sure the subject of this post adequately describes my situation, so let my elaborate.

We have a web form with two textboxes--one for a start date/time and the other for an end date/time. We are wanting to use the validator controls to ensure that the user enters a date/time and that it's in the correct format, along with a couple of other validations. This is easy enough.

Our web page also includes links to navigate back one page or back all the way to the home page. These two actions are valid even if the dates/times in the textboxes are incorrect.

So, our question is... is there any way to 'selectively' validate using the validator controls? Again, clicking back or home should be allowed regardless of the validation, but clicking next should trigger the validation.

Thanks.
 
I'm not sure the subject of this post adequately describes my situation, so let my elaborate.

We have a web form with two textboxes--one for a start date/time and the other for an end date/time. We are wanting to use the validator controls to ensure that the user enters a date/time and that it's in the correct format, along with a couple of other validations. This is easy enough.

Our web page also includes links to navigate back one page or back all the way to the home page. These two actions are valid even if the dates/times in the textboxes are incorrect.

So, our question is... is there any way to 'selectively' validate using the validator controls? Again, clicking back or home should be allowed regardless of the validation, but clicking next should trigger the validation.

There is a property on the button named (I think) CausesValidation.
Set that to False.
 
If you change the links to buttons then you have access to the CausesValidation property. set to false those you do not want to validate
I'm not sure the subject of this post adequately describes my situation, so let my elaborate.

We have a web form with two textboxes--one for a start date/time and the other for an end date/time. We are wanting to use the validator controls to ensure that the user enters a date/time and that it's in the correct format, along with a couple of other validations. This is easy enough.

Our web page also includes links to navigate back one page or back all the way to the home page. These two actions are valid even if the dates/times in the textboxes are incorrect.

So, our question is... is there any way to 'selectively' validate using the validator controls? Again, clicking back or home should be allowed regardless of the validation, but clicking next should trigger the validation.

Thanks.
 
Back
Top