Wednesday, March 28, 2012

Vlidation controls firing twice asp.Net

I have a client side jscript validation routine that I am calling on submit.
This routine makes and AJAX call back to a method on the server which checks
for duplicate records in a DB. (this works fine.)
If there are not any duplicates then the form submits the new record to the
DB via postback and code behind code. (this works fine)
Then for some reason the javascript validation function is called again
which then fails because the new record is already in the DB. The page stil
l
contines on as if all validation passed but a validation message pops up
saying that there are duplicates. Confusing to say the least.
Anyone have any ideas how to prevent or solve this?Try setting CausesValidation =False in the appropriate place
Patrick
"JStemper" <JStemper@.discussions.microsoft.com> wrote in message
news:056C708F-2209-45EA-8C60-4DE7B7D7DA75@.microsoft.com...
> I have a client side jscript validation routine that I am calling on
submit.
> This routine makes and AJAX call back to a method on the server which
checks
> for duplicate records in a DB. (this works fine.)
> If there are not any duplicates then the form submits the new record to
the
> DB via postback and code behind code. (this works fine)
> Then for some reason the javascript validation function is called again
> which then fails because the new record is already in the DB. The page
still
> contines on as if all validation passed but a validation message pops up
> saying that there are duplicates. Confusing to say the least.
> Anyone have any ideas how to prevent or solve this?
>

0 comments:

Post a Comment