Table server control

Y

Yelu Hu

I drop a table server control (table1) on test1.aspx, in
design mode. I put the following code in Page_load event

Private Sub Page_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
' Generate rows and cells.
If Not IsPostBack Then
Dim numrows As Integer = 3
Dim j As Integer
For j = 0 To numrows - 1
Dim r As New TableRow()
Dim c0 As New TableCell()
Dim c1 As New TableCell()
Dim c2 As New TableCell()
Dim radio As New RadioButton()
radio.ID = "RadioButton" & j
radio.GroupName = "Select"
radio.AutoPostBack = True
c0.Controls.Add(radio)
r.Cells.Add(c0)
c1.Controls.Add(New LiteralControl
("Contact Name" & "<br>" & " Contact Company <br> City,
State, Postal <br> Phone <br> Email <br> Fax"))
r.Cells.Add(c1)
Table1.Rows.Add(r)
Next j
End If
End Sub

After page load, I click one of the RadioButtons, the
table disappear. I have to set the radio.AutoPostBack =
True, and to retrive the cell values in table1 cells2
after click one of the radioButtons. Since the table1
disappear, the table1.rows.count is always equal to 0.

What should I do to keep the table1 on test1.aspx,
whenever the clicks happens?

Thanks!
 

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,772
Messages
2,569,593
Members
45,108
Latest member
AlbertEste
Top