0
votes

I have found very similar questions to this one, however none of their answers have been able to offer me a solution to my current predicament.

Basically, what's happening is when the user is focused on a textbox and then clicks the submit button, the textbox sends a postback and the button click event does not get executed. Naturally, I could set AutoPostBack = false, but the textbox is connected to a validator that needs to be checked when focus is lost from the textbox, not just from the button click.

Essentially, I need a way to validate the page each time focus is lost from the textbox, but not perform a postback when it has focus and a button is clicked.

I have considered using Page_ClientValidate() in javascript, but I have custom validators that (as far as I can tell) cannot be replicated client-side.

Any help would be greatly appreciated!

1

1 Answers

0
votes

Instead of using AutoPostBack=true on the textbox , the validator can be moved to a pagemethod or a webservice - on lost focus you could call the pagemethod / webservices to validate the values input in the text box