Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Validating Event and Dialogs

We handle the Validating Event for a textbox on a form.  Inside this event, we run some checks and throw up a Yes\No MessageBox.  Doing this causes some strange behaviors.

In our case, the user enters text in the textbox and then clicks a button. Clicking the button causes the validating event to raise for the textbox.  We show the messagebox and then control never returns to the button's click event handler.  If the user clicks the button a 2nd time, the validating event fires and control does return to the button's click event handler.

Removing the messagebox fixed the problem.

 

 

No Comments