views:

31

answers:

1

I have a button that adds a new row to the view with the following code. Is there a way to increment the label? What I would like is to say "Name 1:" "Name 2:" for every row.

string s = "<table>\r\n";    
s += "  <tr>\r\n";
s += "    <td>\r\n";
s += "      <label>Name: </label>";
s += "      <input></input>";
s += "    </td>\r\n";
s += "    <td>\r\n"
s += "</table>\r\n";
+1  A: 

Pass the index of that previous row into whatever calls this code. Add 1.

jfar