I have a gridview that has a dropdown list in each row. The dropdowns are named ur1,url2,url3 etc.
I would like to combine the selected values of all those dropdowns into a comma separted list and store it in a hidden field.
Any help is appreciated.
Dodge20
I would like to combine the selected values of all those dropdowns into a comma separted list and store it in a hidden field.
Code:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="ProductName" HeaderText="Columns"
SortExpression="ProductName" />
<asp:TemplateField AccessibleHeaderText="MapTo" HeaderText="MapTo">
<ItemTemplate>
<select name='URL<%# Container.DataItemIndex + 1 %>' onchange='update_selection(this);'>
<option value=''>Select a Continent</option>
<option value='North America'>North America</option>
<option value='South America'>South America</option>
<option value='Africa'>Africa</option>
<option value='Europe'>Europe</option>
<option value='Asia'>Asia</option>
<option value='Australia'>Australia</option>
</select>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Any help is appreciated.
Dodge20