DataList:get Values

S

SJ

I have a dropdownlist("myList") in my DataList control. When a user selects
one of the
items in the dropdownlist, I need to access the value of the DataBound Label
("myLabel") in the Datalist and display it in a popUp window. I have to do
all of this in Codebehind and not inline scripting. Any idea how I can
accomplish this?

<asp:DataList id="testList" runat="server">
<ItemTemplate>

<asp:DropDownList id="myList" runat="server">
<asp:ListItem value="Item1"></asp:ListItem>
<asp:ListItem value="Item2"></asp:ListItem>
</asp:DropDownList>

<asp:Label id="myLabel"><%# DataBinder.Eval(Container.DataItem,
"DataValue")%>
</asp:Label>

</ItemTemplate>
</asp:DataList>


Thanks.
 

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,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top