DataList and TextBox

Discussion in 'ASP .Net Web Controls' started by Thomas, Nov 9, 2003.

  1. Thomas

    Thomas Guest

    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.
    Thomas, Nov 9, 2003
    #1
    1. Advertising

  2. Thomas

    Jos Guest

    Thomas wrote:
    > 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, ...)?

    --

    Jos
    Jos, Nov 10, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nevyn Twyll
    Replies:
    8
    Views:
    1,867
  2. Replies:
    4
    Views:
    12,400
    Teemu Keiski
    Jun 20, 2005
  3. Hillbilly
    Replies:
    2
    Views:
    363
    bruce barker
    Sep 2, 2008
  4. Lorna70
    Replies:
    0
    Views:
    1,344
    Lorna70
    Aug 25, 2009
  5. Person in Need

    Issue getting data back from textbox in Datalist and container

    Person in Need, Sep 5, 2007, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    205
    Person in Need
    Sep 5, 2007
Loading...

Share This Page