Nested Dropdown list inside a datalist: Retrieve values

M

Mark

Hi, I have a datalist that contains a textbox as well as a dropdown list.

For each single row in the datalist the associated dropdown list can have at
least one value

What I would like to be able to do is when a single update button is clicked
the textbox value along with the associated dropdown value is printed for
each row in the datalist.

The number of rows in the datalist can vary. Here is my Datalist code

====================
<asp:DataList id="DataList1" runat="server" DataKeyField="PersonID">
<ItemTemplate>
<asp:TextBox ID="txtName" Runat="server" Text='<%#
Container.DataItem("Firstname") %>' Enabled="False">
</asp:TextBox>
</td>
<td>
<asp:DropDownList ID="dlNotChild" Runat="server" DataSource="<%#
GetNotChild() %>" DataTextField="PersonName" DataValueField="PersonID">
</asp:DropDownList>
</td>
</ItemTemplate>
</asp:DataList>
====================

The main datalist is bound to a dataview as is the dropdown list
(GetNotChild routine)

Thanks for your time
Regards
Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top