TextChanged eats up all other events

X

xcomplus

Hi,

I have a page with textboxes, checkboxes, buttons, etc. One of textboxes has
Autopostback=true. I am using TextChanged event of this textbox to populate
some other read only textboxes from the DB. If I change the textbox with
autopostback=true and click on anything else in the page using the mouse,
e.g., click on other editable textboxes, checkboxes, etc, only the
TextChenaged event is called. If I click on another textbox I see the edit
focus in that textboxes temprarily, as soon as the page is posted back from
the server, the edit focus is gone. If I click on another checkbox, I see the
checkbox get checked temprarily, as soon as the page is posted back from the
server, the check on that checkbox is gone. Can anybody tell me how to
overcome this problem?

Thanks.
any of the buttons all events fire as expected Page_Load,
TextChanged, Button.Click. However if textbox is not empty (already
contains some text) and I just change this text and click on the button
I get only Page_Load and Textchanged fired, no Button.Click event.
Does anyone knows what is the problem and how to workaround it?


Thanks.
 
X

xcomplus

I am posting the previous message again, since the original one I posted has
some extra text that is not related to this case.

Hi,

I have a page with textboxes, checkboxes, buttons, etc. One of textboxes has
Autopostback=true. I am using TextChanged event of this textbox to populate
some other read only textboxes from the DB. If I change the textbox with
topostback=true and click on anything else in the page using the mouse, e.g.,
click on other editable textboxes, checkboxes, etc, only the TextChenaged
event is called. If I click on another textbox I see the edit focus in that
textboxes temprarily, as soon as the page is posted back from the server, the
edit focus is gone. If I click on another checkbox, I see the checkbox get
checked temprarily, as soon as the page is posted back from the server, the
check on that checkbox is gone. Can anybody tell me how to overcome this
problem?

Thanks.
 
L

Leo

Here's my best guess:

You enter text in the autopostback textbox. You then click another
checkbox. As soon as the autopostback textbox looses focus the page is
posted back to the server. This happens before the checkbox is checked so
the checking of the checkbox is not in the viewstate data for the posted
back page. While the round trip is occuring to the server and back to you,
your browser is correctly rendering the checking of the checkbox on your
local system. Now you get the data back from the postback to the server,
but the server never saw the checkbox checked, so it is missing on the
response the server sends to you. It's just a matter of the timing of
events.
 

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

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,522
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top