T
Tony
win xp - vs 2002 - vb - web forms
I have this code in the page_load event.
works fine except, I put it all in an if not ispostback then.
I don't want to run all this code (will get much bigger) each round trip.
The table disappears on each round trip, unless I leave it out of the not
isposback.
Anyway to create once or do I have to run this code each round trip?
Thanks Tony
table.Visible = True
table.BackColor = Color.Ivory
table.GridLines = GridLines.Both
table.Visible = True
For rowloop = 0 To 5
Dim trow As New TableRow()
For cellsloop = 0 To 2
Dim tcell As New TableCell()
trow.Cells.Add(tcell)
Next cellsloop
table.Rows.Add(trow)
table.Rows(rowloop).Cells(0).VerticalAlign =
VerticalAlign.Middle
table.Rows(rowloop).Cells(0).Width() = Unit.Pixel(200)
table.Rows(rowloop).Cells(1).Width() = Unit.Pixel(200)
table.Rows(rowloop).Height = Unit.Percentage(100)
table.Rows(rowloop).Cells(0).Wrap = True
Next rowloop
labFirstName.Text = "Enter Frist Name"
table.Rows(0).Cells(0).Controls.Add(labFirstName)
labLastName.Text = "Enter Last Name"
table.Rows(1).Cells(0).Controls.Add(labLastName)
labEMail.Text = "Enter E-Mail Address"
table.Rows(2).Cells(0).Controls.Add(labEMail)
table.Rows(0).Cells(1).Controls.Add(txtFirstName)
table.Rows(1).Cells(1).Controls.Add(txtLastName)
table.Rows(2).Cells(1).Controls.Add(txtEMail)
Page.Controls(1).Controls.Add(table)
table.Style.Add("10", "Z-INDEX: 101; LEFT: 150px; POSITION:
absolute; TOP: 150px")
I have this code in the page_load event.
works fine except, I put it all in an if not ispostback then.
I don't want to run all this code (will get much bigger) each round trip.
The table disappears on each round trip, unless I leave it out of the not
isposback.
Anyway to create once or do I have to run this code each round trip?
Thanks Tony
table.Visible = True
table.BackColor = Color.Ivory
table.GridLines = GridLines.Both
table.Visible = True
For rowloop = 0 To 5
Dim trow As New TableRow()
For cellsloop = 0 To 2
Dim tcell As New TableCell()
trow.Cells.Add(tcell)
Next cellsloop
table.Rows.Add(trow)
table.Rows(rowloop).Cells(0).VerticalAlign =
VerticalAlign.Middle
table.Rows(rowloop).Cells(0).Width() = Unit.Pixel(200)
table.Rows(rowloop).Cells(1).Width() = Unit.Pixel(200)
table.Rows(rowloop).Height = Unit.Percentage(100)
table.Rows(rowloop).Cells(0).Wrap = True
Next rowloop
labFirstName.Text = "Enter Frist Name"
table.Rows(0).Cells(0).Controls.Add(labFirstName)
labLastName.Text = "Enter Last Name"
table.Rows(1).Cells(0).Controls.Add(labLastName)
labEMail.Text = "Enter E-Mail Address"
table.Rows(2).Cells(0).Controls.Add(labEMail)
table.Rows(0).Cells(1).Controls.Add(txtFirstName)
table.Rows(1).Cells(1).Controls.Add(txtLastName)
table.Rows(2).Cells(1).Controls.Add(txtEMail)
Page.Controls(1).Controls.Add(table)
table.Style.Add("10", "Z-INDEX: 101; LEFT: 150px; POSITION:
absolute; TOP: 150px")