How do find out if a button was clicked before the textchanged event of textbox fires

Discussion in 'General Computer Support' started by Jack, Oct 27, 2006.

  1. Jack


    Oct 27, 2006
    Likes Received:
    I am working in VS2003 using

    I have a page that contains a textbox with autopostback set to True and validation code in the textchanged event.

    I also have a cancel button on this page that clears all textboxes and disables all the controls on the page.

    The problem is, if I populate the textbox and click the cancel button the validation in the textchanged event runs before the code in the button's click event. The textbox validation must run when any of the other buttons on the page are clicked and also when the user tabs off the textbox, but I want to bypass it when the cancel button is clicked.

    Is there any way of getting hold of the button's id so that i can prevent the code in textchange event if the button is 'cancel'?
    Jack, Oct 27, 2006
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.