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

  • Thread starter Pablo Gutierrez
  • Start date
P

Pablo Gutierrez

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.
 

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,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top