Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > when the asp:table is constructed programmatically, it's contents is lost in a postback

Thread Tools

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

Pablo Gutierrez
Posts: n/a
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

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:

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

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?


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Querying a dynamically constructed html table ukrbend HTML 3 11-29-2005 08:52 PM
.Net Datagrid contents lost on postback Jeff ASP .Net 10 10-24-2005 03:00 PM
Giving the preorder & inorder lists, How can be constructed the corresponding B-TREE ? David Méndez C++ 9 11-16-2004 09:40 AM
Validity of the this pointer before the object is constructed tuko C++ 4 09-17-2004 05:04 AM
Function matching with constructed args Mike Cote C++ 1 01-22-2004 09:30 PM