Last post Apr 10, 2012 08:45 PM by jprochazka
Apr 10, 2012 08:26 PM|ebngrtr083|LINK
I recently created a contact page where a user can send administration a message about any kind of topic. I created a few textboxes and have some validation controls set to each of them which work perfectly. The only problem is if you try to navigate
away from the page without typing anything into the textbox controls, then the validation controls execute and prevent the user from navigating away from the page. Does anyone know why this is happening and what I can do to fix this? Thank you for your help
Apr 10, 2012 08:31 PM|jprochazka|LINK
Try setting the validationgroup to the same name on each validation control and then on the button used to submit the form to see if that clears things up.
Apr 10, 2012 08:42 PM|ebngrtr083|LINK
Thank you for your prompt response, it is appreciated. I believe I found the answer I was looking for though. On button control there is a property called "CausesValidation" and by default it is set to true. By setting this property to false for each
button that is not supposed to perform a validation ( like my site navigation buttons ) then it bypasses the validation controls and will navigate to the next page. Thank you again for your help
Apr 10, 2012 08:45 PM|jprochazka|LINK
That would work to.
For future referance setting validationgroup will allow you to have multiple buttons validating only form items contained within the validation group it is assigned to meaning even if all buttons are set to causevalidation if the validation group is set on
a button it will only validate the controls belonging to that group.