when the asp:table is constructed programmatically, it's contents is lost in a postback

Discussion in 'ASP .Net Web Controls' started by Pablo Gutierrez, Oct 3, 2003.

  1. I have a problem with the TABLE ASP NET control.
    I'm trying to add rows and cells to an ASP:TABLE programmatically, but it
    seems that when the table is filled is that way, the content is lost between
    postbacks.

    I'd like to fill the table only once (i.e. when Page.IsPostBack=False), but
    the table must be filled dynamically since the number of rows and cells is
    not known at design time.

    Here are the pages:

    ifraMenu.aspx
    ==========
    <asp:table id="tblMenuL1" runat="server" CellSpacing="0" CellPadding="0"
    Height="23px" Width="100%">
    </asp:table>


    ifraMenu.aspx.vb
    ============
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles MyBase.Load
    If (Page.IsPostBack=false) Then
    .... Add rows and cells to table tblMenuL1
    end if
    ....
    End sub
    ===================================
    I've tried using EnableViewState when creating the rows and the cells, but
    anyway the rows and cells disappears at the first postback.
    Is there any simple way to do this?

    Regards,
    Pablo.
    Pablo Gutierrez, Oct 3, 2003
    #1
    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. Jeff
    Replies:
    10
    Views:
    5,164
  2. ukrbend
    Replies:
    3
    Views:
    370
    ukrbend
    Nov 29, 2005
  3. Mike Cote
    Replies:
    1
    Views:
    325
    Ron Natalie
    Jan 22, 2004
  4. tuko
    Replies:
    4
    Views:
    377
    Dave Rahardja
    Sep 17, 2004
  5. David Méndez
    Replies:
    9
    Views:
    498
    Dave Vandervies
    Nov 16, 2004
Loading...

Share This Page