I have a table which uses a large number of form fields (the HTML variety - i.e. without runat=server). When a postback occurs, these populate the Requests.Form object, and they appear to be inserted in the same order as they're defined in the page HTML.
Is this behaviour documented and consistent across browsers? I'd like to be able to access the elements by index, which would provide a simple way to find the fields, given that they may be inserted or deleted on the client side.
Edit:
Each row in the table has a hidden field which contains the row ID. This field is named according to the order it was displayed at render time. e.g. the first row has a field like <input type="hidden" name="row0" value="RowID_555252" />
, and so on.
Of course the row numbers will be wrong as soon as a row is inserted or deleted in the middle of the table, so the only solution I can think of is to use Javascript to update the row numbers of the entire table whenever the rows move about. The backend would then retreive rows in order by scanning Request.Form for row0, row1, etc until the element is NULL.