Another WebForm question

In a case where there is a form with indexed entries like the following:

<li>
<input type=“hidden” id=“id[0]” value=“3” />
<input type=“textbox” id=“sequence[0]” value=“10” />
</li>
<li>
<input type=“hidden” id=“id[1]” value=“4” />
<input type=“textbox” id=“sequence[1]” value=“20” />
</li>

How do I loop through this on postback?

if (IsPostBack) { //what goes here? }

In this case, I am using a standard form, so we’ll need to use Request.Form, I just don’t know how to access an indexed value.

Request.Form[“sequence[0]”] !?

actually it should be <input type=“textbox” name=“sequence[1]” value=“20” />

Yeah, nice catch on the id vs name thing, but what about when I don’t know how many indicies there will be?

Haven’t done this in a while. But if I remember correctly, it needs to be name=“id” for all of them. Then you loop the the Request.Form KeyValuePairs

Ah thanks. That seems ring some bells. I’ll give it a try.