I'm have a Table Web Server in which I am attempting to dynamically
add an additional row each time the user clicks on a link button.
My table has one static header row, then additional rows will be
added as needed by the user click.
What I'm currently attempting to do is capture if its a Postback,
then generate the row accordingly. Currently, no matter how many
times a user clicks, it appears as though the values never get
updated. Below is my code w/ a few questions after.
***********
Public Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
' Total number of rows
Dim rowCnt As Integer
' Current row count
Dim rowCtr As Integer
' Total number of cells (columns)
Dim cellCtr As Integer
' Current cell counter
Dim cellCnt As Integer
rowCnt = rowCnt + 1
cellCnt = 8
For rowCtr = 1 To rowCnt
Dim tRow As New TableRow()
For cellCtr = 1 To cellCnt
Dim tCell As New TableCell()
tCell.Text = "Row " & rowCtr & ", Cell " & cellCtr
' Add new TableCell object to row
tRow.Cells.Add(tCell)
Next
' Add new row to table
Table1.Rows.Add(tRow)
Next
rowCnt = rowCtr 'rowCtr has the current total of rows
End Sub
********
Do I need to put the rowCnt into ViewState or a session? As my hope
is that when I first add a new row, rowCtr would then be 1, so
rowCnt would then be 1+1 and so on...
Once I start adding the new rows, once again, will I need to use
ViewState or a session for the rows and their associated data?
Thanks so much for your help.
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/