Datalist adding Dynamic controls

Discussion in 'ASP .Net' started by Patrick, Jan 28, 2004.

  1. Patrick

    Patrick Guest

    Hello

    I have a Datalist, that I fill with the PopulateList() method. This method
    selects all Items from Database and binds the Dataset to the DataLilst. Now,
    when clicking Edit, in the Editcommand I add some dynamic TextBoxes to a
    PlaceHolder in the EditItemTemplate.

    So fare, all fine - now, when I select Update, in the UpdateCommand-Event I
    want to get the Value of these added TextBoxes. My Problem is now, when I
    just search for the PlaceHolder and check all controls inside, it is empty.
    So I run the PopulatePlaceHolder method also in the UpdateCommand and i find
    the controls, but they don't have any values inside.

    Can someone help me

    Thanks
    Patrick
    Patrick, Jan 28, 2004
    #1
    1. Advertising

  2. Patrick

    Jos Guest

    "Patrick" <> wrote in message
    news:%...
    > Hello
    >
    > I have a Datalist, that I fill with the PopulateList() method. This method
    > selects all Items from Database and binds the Dataset to the DataLilst.

    Now,
    > when clicking Edit, in the Editcommand I add some dynamic TextBoxes to a
    > PlaceHolder in the EditItemTemplate.
    >
    > So fare, all fine - now, when I select Update, in the UpdateCommand-Event

    I
    > want to get the Value of these added TextBoxes. My Problem is now, when I
    > just search for the PlaceHolder and check all controls inside, it is

    empty.
    > So I run the PopulatePlaceHolder method also in the UpdateCommand and i

    find
    > the controls, but they don't have any values inside.


    You need to run the PopulatePlaceHolder method in Page_Init instead,
    so that the controls are already in place when they are filled with their
    viewstate information (this happens after Page_Init and before Page_Load).

    --

    Jos Branders
    Jos, Jan 28, 2004
    #2
    1. Advertising

  3. Patrick

    Patrick Guest

    Hi Jos

    > You need to run the PopulatePlaceHolder method in Page_Init instead,
    > so that the controls are already in place when they are filled with their
    > viewstate information (this happens after Page_Init and before Page_Load).


    Thanks for your answer. This is a good Idea, but the problem is, I add this
    TextBoxes to the EditItemTemplate, so on the PageInit there is nothing in
    Edit, so it won't add anything. And afterwards, when I edit something, that
    code won't be executed.

    any other good ideas?
    Thnx
    Patrick, Jan 28, 2004
    #3
    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. Scott Schluer

    DataList & Dynamic Controls

    Scott Schluer, Feb 8, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    3,213
    meenugoel
    May 27, 2014
  2. Nevyn Twyll
    Replies:
    8
    Views:
    1,866
  3. Ronald
    Replies:
    2
    Views:
    835
    Robbe Morris [C# MVP]
    Jan 17, 2006
  4. Vishal

    Adding recursive datalist controls

    Vishal, Mar 18, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    157
    Vishal
    Mar 18, 2005
  5. Denny Smolinski via .NET 247

    Dynamic Controls, Placeholder, Retrieve Information from Dynamic Controls

    Denny Smolinski via .NET 247, May 4, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    459
    Eidolon
    May 4, 2004
Loading...

Share This Page