Disable AutoPostBack?????

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.
 
H

Henning Krause [MVP - Exchange]

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
 
G

Guest

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
 
I

intrader

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top