We are updating an existing form that had 15 hardcoded rows in a HTML table.
We are working on adding additional rows based on the number of rows filled in, when they reach the last row, a new row will be added. But with that, how can we change this method to handle any number of rows to be able to calculate the totals correctly.
private decimal CalcTotalPrice() { decimal tot1 = Convert.ToDecimal(txtTotal1.Text); decimal tot2 = Convert.ToDecimal(txtTotal2.Text); decimal tot3 = Convert.ToDecimal(txtTotal3.Text); decimal tot4 = Convert.ToDecimal(txtTotal4.Text); decimal tot5 = Convert.ToDecimal(txtTotal5.Text); decimal tot6 = Convert.ToDecimal(txtTotal6.Text); decimal tot7 = Convert.ToDecimal(txtTotal7.Text); decimal tot8 = Convert.ToDecimal(txtTotal8.Text); decimal tot9 = Convert.ToDecimal(txtTotal9.Text); ...

Go to the complete details ...