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

Strange textbox behaviour: re-creatable

P: n/a
Hi,

Make up a very simple project as follows:

1 aspx form
3 web user controls (referred to as A, B, and C)

"A" web user control:
Put 1 textbox and 1 button on this web user control. (You must do
this exactly!)

"B" web user control:
Put 1 textbox and 1 button on this web user control as well.

"C" web user control:
Put "A" and "B" web user controls on to this web user control.
Then put a multi tab strip and a multi tab page control on this
control. Now, wire up the multi tab strip and multi tab page controls
correctly so that 2 multi tab strips tabs "hold/point to" the "A" and
"B" web user controls.

Now run the test app.

Click on the second multi tab strip, so that you see the "B" web user
control, then type something inside the textbox. Now press the return
key. The problem is that no post back occurs. (But carry on reading
for the interesting twist.) If you have your speakers turned on, you
might hear a "ping error" sound.

Please notice that if you click the first tab, and type in text in to
the textbox that is on the "A" web user control, a postback does
occur.

Also notice that if you set the autopostback property of the textbox
on "B" web user control to true, you still get the same result.

Also, if you create a TextBox1_TextChanged server side event handler,
you still get the same result.

Here's the really intesting part of this experiment: edit the web user
control "A", and either remove the 1 button (leaving the 1 textbox),
or remove the 1 textbox (leaving the button). Now re-run the test
app, and repeat the main test above. When you press the return key on
the textbox inside web user control "B", the postback works! (You can
also remove both textbox and button on web user control "A" to ensure
that the postback works on web user control "B".)

I'm having other more serious problems that are very much related to
this issue above. In my main project (away from this test example),
when I press the return key, I do get a postback, but the navigation
unexpectedly leaves the aspx form that contains my webuser controls
and takes me back to the home page!!! (This is causing me some
problems!)

TIA for any thoughts,
-dnw
Nov 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.