Accessing values of child controls after postback

Discussion in 'ASP .Net Building Controls' started by Martin Pichler, Jul 18, 2003.

  1. Hi!

    I have a placeholder to which i add a Table with 2 columns. In one of the
    columns are textboxes with an unique ID (box1, box2, .... boxN). the user is
    supposed to enter values into these textboxes and then klick submit (button
    is static). on the click event i want ro read out the values of the boxes
    and save them into a database.
    here comes the Problem:
    with Findcontrols("Box1") i am unable to find my dear textboxes!
    plDetails.controls.count gives always zero (it should be one since the is a
    Table)!

    obviously they all vanish... or something alike.

    i dont care if the values get saved in the viewstate, i just want to read
    them out and save em!

    Any ideas?

    any help appreciated!

    Thanx martin
     
    Martin Pichler, Jul 18, 2003
    #1
    1. Advertisements

  2. Martin Pichler

    Teemu Keiski Guest

    If you create controls dynamically, you need to that on every request
    despite is it postback or not. That means adding Table etc to Placeholder on
    every request and in same order. That way you could access values after
    postback.

    --
    Teemu Keiski
    MCP,Designer/Developer
    Mansoft tietotekniikka Oy
    http://www.mansoft.fi

    AspInsiders Member, www.aspinsiders.com
    ASP.NET Forums Moderator, www.asp.net
    AspAlliance Columnist, www.aspalliance.com
     
    Teemu Keiski, Jul 18, 2003
    #2
    1. Advertisements

  3. Martin Pichler

    elkay Guest

    Can you post a snippet of your code...
    I am having a similar problem. I have posted my problem in
    microsoft.public.dotnet.framework.aspnet.webcontrols
    "Passing controls......in placelholder......."
    Would appreciate any help in this regard.
     
    elkay, Dec 22, 2004
    #3
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.