Disable AutoPostBack?????

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a textbox with Autopostback = true.
I also have in JavaScript that checks the value before the postback occurs

OnBlur = "return CheckValue(myValue)"

Ive always gotton it to work with command buttons that if the return value
was false, then the Server-side method behind the button would not execute.

But how can I do the same for a textbox with AutoPostBack set to true? It
performs the postback regardless if the return value was true or false.
 
Hello,

you should perhaps use a CustomValidadator here to check your own
constraints. It has a property called ClientValidationFunction, which is
called before post back.

Best regards,
Henning Krause
 
We have given up on using the .NET validators because of poor reliability and
scope which we need them defined. Even on PCs with the same OS and frame
work, it was a crapshoot if they would work as intended on one PC and not
another

Coding our on validation has proved more reliable



--
JP
..NET Software Developer


Henning Krause said:
Hello,

you should perhaps use a CustomValidadator here to check your own
constraints. It has a property called ClientValidationFunction, which is
called before post back.

Best regards,
Henning Krause
 
JP said:
I have a textbox with Autopostback = true.
I also have in JavaScript that checks the value before the postback occurs

OnBlur = "return CheckValue(myValue)"

Ive always gotton it to work with command buttons that if the return value
was false, then the Server-side method behind the button would not execute.

But how can I do the same for a textbox with AutoPostBack set to true? It
performs the postback regardless if the return value was true or false.
Catch it at the submit event on the form. That event occurs and the
true/false behavior of its events works so you can have some state to
controls submittal.

Hope this helps.

P.S. I am with you with the validation capabilities of .net. We roll our
own much more efficient client and server validators.
 
Back
Top