473,383 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

postback for dynamically created table

Hi,

I have the following code in my page load event that creates a table on the
web page.
The trouble is that after a postback such as a button click on the page the
table is not retained but ignored.

If Not IsPostBack() Then
Response.Write("This is NOT a postback<br>")
Dim tblMain As New Table
Dim tblRow As New TableRow
Dim tblCell As New TableCell

tblMain.Rows.Add(tblRow)
tblCell.Text = "hello"
tblMain.Rows(0).Cells.Add(tblCell)

Controls.Add(tblMain)
Else
Response.Write("This is a postback<br>")
End If
I would apprecaite advice on how to redisplay the table without actually
re-building it everytime the page re loads.

cheers

martin.
Nov 18 '05 #1
1 1617
any dynamically created controls should be created on every postback. the
best place to keep them is in Init method of the page.

Av.
"martin" <St**************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,

I have the following code in my page load event that creates a table on
the
web page.
The trouble is that after a postback such as a button click on the page
the
table is not retained but ignored.

If Not IsPostBack() Then
Response.Write("This is NOT a postback<br>")
Dim tblMain As New Table
Dim tblRow As New TableRow
Dim tblCell As New TableCell

tblMain.Rows.Add(tblRow)
tblCell.Text = "hello"
tblMain.Rows(0).Cells.Add(tblCell)

Controls.Add(tblMain)
Else
Response.Write("This is a postback<br>")
End If
I would apprecaite advice on how to redisplay the table without actually
re-building it everytime the page re loads.

cheers

martin.

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Krista Lemieux | last post by:
I'm new to ASP.NET and I'm not use to the way things are handled with this technology. I've been told that when I have a control, I should only bind the data to it once, and not on each post back...
1
by: Marcus | last post by:
I have a problem maybe one of you could help me with. I've created a data entry screen with lots of dynamically-created client-side controls. I create HTML texboxes client-side by assigning a...
3
by: Tim | last post by:
Hello All, Hope someone can point me in the right direction here. I have a ASPX page that is being created dynamically. My function adds Labels and Text Boxes to a Table ready for the user to...
4
by: Gregory Gadow | last post by:
If there is a more appropriate forum, please let me know and I will post there. Our field reps can go on to our website and select from several sets of data to create the address we then provide...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.