Strange textbox behaviour: re-creatable

D

Dot net work

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
 

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,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top