Newbie Question - AutoPostBack

D

damiensawyer

Hi,

I'm wondering if someone can help me with an autopostback issue.

I have three controls

Textbox1
Textbox2
button1

The textbox's have autopostback set to true. This is because we need to
do some validation in the textchanged event when they leave the control
to update a 'valid/invalid' label.

The thing is, I want to set up behaviour so that, when the user presses
the button, this validation is bypassed. I want the pressing of the
button to effective negate the autopostback of the textboxes.

I can't seem to be able to find a way to catch that the button has been
pressed. In the Page_Load event of the form when I catch the 'sender'
it seems to be giving me the form object. In the TextChanged event of
the textbox, 'sender' is giving me that textbox.

What I need, is a way to find out that the control that was pressed to
trigger the text changed event, was the button control (actually, it's
an anchor link, but I doubt that makes a difference.

Any help would be very much appreciated and thanks in advance,


Damien Sawyer
 
D

damiensawyer

Hmmmm... that didn't seem to address the issue. Maybe I can put it more
clearly.

TextBox1 (as do the other textboxes ) has autopostback set to true.
This is to validate the entry and update a label. There is a final
submit button to process the 'order'

As far as I can see ,events are happening in this order.

1/ User enteres text in text box 1
2/ User clicks submit button
3/ Textbox1 textchanged event fires (updating labels)
4/ Control returns to the user [**** this is where I want to detect
button press and run more code]
5/ User has to click submit button again
6/. Form submits.

Basically - I want to get rid of the second button click.

Any suggestions anyone? Thanks in advance.



Damien Sawyer
 

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