DataList and TextBox

T

Thomas

When creating a WebForm how can I get the OnTextChanged
event to fire for a TextBox in a DataList on an asp page?
Here is the DataList I am using:

<asp:DataList id="DataList1" runat="server">
<ItemTemplate>
<asp:TextBox id="tb1" runat="server"

OnTextChanged="DataListTextBoxChanged">
</asp:TextBox>
</ItemTemplate>
</asp:DataList>

If I have the TextBox outside the DataList the event fires
perfectly.
 
J

Jos

Thomas said:
When creating a WebForm how can I get the OnTextChanged
event to fire for a TextBox in a DataList on an asp page?
Here is the DataList I am using:

<asp:DataList id="DataList1" runat="server">
<ItemTemplate>
<asp:TextBox id="tb1" runat="server"

OnTextChanged="DataListTextBoxChanged">
</asp:TextBox>
</ItemTemplate>
</asp:DataList>

If I have the TextBox outside the DataList the event fires
perfectly.

The event should fire normally.
The reason could be that the textbox is not recreated at postback.
Is ViewState on for the page?
Is the state of the datalist changed on postback (EditItemIndex,
SelectedIndex, ...)?
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top