User Control Events

E

Eran Amitai

Hi,

Could anybody help with the following problem? I created a page with two
autopostback (a drop down and text box) controls, hooked up events, and
everything worked fine. I then converted the page to a user control (moved
the HTML and code to an ascx and ascx.cs files) and included it in another
page.

I see the controls on the page and my events are activated as expected.
However, when I try to access the controls from the event code the values
are not correct. The dropdown control always reports a SelectedIndex of zero
and the textbox an empty text, even though the actual request arrives with
the correct values (I used Trace="true" to view the actual data sent).

Am I missing anything? I am especially confounded about the fact that the
events fire. If I select something in the drop list it does post back and
the event is raised, meaning the control recognized the change. So why
doesn't the internal state reflect the new value?

Thanks,
Eran
 

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,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top