BrianAnneot
New Member
I have a simple html table control that is emtpy (i.e. no rows). I have two check boxes, one to that adds a row (More) when checked and one that deletes a row (Less) when checked. Both are AutoPostBack enabled. I also have a hidden input field (Pic_Count) that holds the number of current rows. I can successfully add a row when the check box to add a row is checked. But when I un-check the check box (either manually or in the code), the row disappears. I know it is because checking or un-checking is a postback so I currently have this code in my Page_Load:<BR><BR> If More.Checked Then<BR> Pic_Count.Value = http://aspmessageboard.com/archive/index.php/Pic_Count.Value + 1<BR> More.Checked = False<BR> ElseIf Less.Checked Then<BR> Pic_Count.Value = Pic_Count.Value - 1<BR> Less.Checked = False<BR> End If<BR> Dim i As Integer<BR> For i = 1 To Pic_Count.Value<BR> Dim Row As New HtmlTableRow()<BR> Dim Cell1 As New HtmlTableCell()<BR> Dim Cell2 As New HtmlTableCell()<BR> Cell1.Width = "125px"<BR> Cell1.InnerText = "Picture " & i<BR> Row.Cells.Add(Cell1)<BR> Cell2.InnerHtml = "<input style=""" & "WIDTH: 200px""" & "type=""" & "file""" & "name=""" & " picture_" & i & """"<BR> Row.Cells.Add(Cell2)<BR> Table2.Rows.Add(Row)<BR> Next<BR><BR>It solves my problem, BUT I would like to know if I there is someway to permanently add or delete rows so I don't have to generate the rows each and every postback.<BR><BR>TIA,<BR>LDawg