By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,373 Members | 1,792 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,373 IT Pros & Developers. It's quick & easy.

Asp.Net & Event-handles

P: n/a
Hi, i need to catch two events in then same post (a
TextBox_TextChanged and a Button_Click), but sometimes
dot.net catch these events in one post correctly and
sometimes catch only one event (TextBox_TextChanged) and
not the event Button_Click.
Can you help me please?
Thank's.
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Since only one of these events could happen at a time (you can't change some
text at the same instant you are clicking a button), they will each cause
the page to be regenerated at the server. Once the page has been
re-generated, your event handler (for the event that caused the new page)
will fire.

You could write a generic sub and add a handler for each of the controls to
it and not write any code for the native event handlers:

Sub Do2ThingsAtOnce (byVal Sender As System.Object) Handles
TextBox.TextChanged, Button.Click

Code for textbox
Code for button

End Sub

By including the Sender parameter in the sub declaration, you could then
trap for which object raised the event (if you wanted that capability).

"Francesco" <fr***************@gruppodatel.it> wrote in message
news:04****************************@phx.gbl...
Hi, i need to catch two events in then same post (a
TextBox_TextChanged and a Button_Click), but sometimes
dot.net catch these events in one post correctly and
sometimes catch only one event (TextBox_TextChanged) and
not the event Button_Click.
Can you help me please?
Thank's.

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.