I am working on a project that I want to "+Add Row" to. This will Add a row of four fields that are textboxes. The # of rows is variable so I created a literal control and have been doing
Protected Sub btnAddRow_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAddRow.Click
Dim OfficeEquipmentRow As String = "<div class='EquipmentListing Equipment'><input type='text' Class='WorksheetInputStyle' ID='OfficeEquipment" & Session("OfficeRow") & "' runat='server'></div>"
Dim OfficePriceRow As String = "<div class='EquipmentListing Price'><input type='text' Class='WorksheetInputStyle' ID='OfficePrice" & Session("OfficeRow") & "' runat='server'></div>"
Dim OfficeQuantityRow As String = "<div class='EquipmentListing Quantity'><input type='text' Class='WorksheetInputStyle' ID='OfficeQuantity" & Session("OfficeRow") & "' runat='server'></div>"
Dim OfficeTotalRow As String = "<div class='EquipmentListing Totals'><span Class='Totals' ID='OfficeTotal" & Session("OfficeRow") & "' runat='server'>$</span></div> "
litUpdate.Text += OfficeEquipmentRow & OfficePriceRow & OfficeQuantityRow & OfficeTotalRow
Session("OfficeRow") = Session("OfficeRows") + 1
End Sub
The only issue is when I hit Add Button again all the data that may have been input into the literal control's text boxes disappears. This will be very very annoying to the end user. How can I retain this information?