J
jjack100
I have a form that is submitted to another page. The form contains a
variable number of dropdownlists within a repeater. When the form is
submitted, I need to access the values of each dropdownlist. I never
know how many dropdownlists will be present in advance.
Also, both the repeater and the dropdownlists are nested within other
controls:
ctl00$ContentPlaceHolder1$rptOptions$ctl01$dlOptions
So how can I access the dropdownlists? I am using PreviousPageType on
the page that the form is being posted to.
I thought it would be something like this:
foreach (RepeaterItem item in rptOptions.Items)
{
DropDownList b = (DropDownList)item.FindControl("dlOptions");
Response.Write(b.Text + "<br>");
}
But I just can't get the syntax right.
Thanks
Jack
variable number of dropdownlists within a repeater. When the form is
submitted, I need to access the values of each dropdownlist. I never
know how many dropdownlists will be present in advance.
Also, both the repeater and the dropdownlists are nested within other
controls:
ctl00$ContentPlaceHolder1$rptOptions$ctl01$dlOptions
So how can I access the dropdownlists? I am using PreviousPageType on
the page that the form is being posted to.
I thought it would be something like this:
foreach (RepeaterItem item in rptOptions.Items)
{
DropDownList b = (DropDownList)item.FindControl("dlOptions");
Response.Write(b.Text + "<br>");
}
But I just can't get the syntax right.
Thanks
Jack