DataList:get Values

Discussion in 'ASP .Net Web Controls' started by SJ, Sep 28, 2005.

  1. SJ

    SJ Guest

    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.
    SJ, Sep 28, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gönen EREN

    Datalist in Datalist How?

    Gönen EREN, Aug 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    404
    Gönen EREN
    Aug 22, 2003
  2. acko bogicevic

    DataList in DataList

    acko bogicevic, Nov 10, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    5,506
    acko bogicevic
    Nov 11, 2003
  3. Steve Lloyd
    Replies:
    1
    Views:
    697
    Rick Spiewak
    May 26, 2004
  4. Nevyn Twyll
    Replies:
    8
    Views:
    1,864
  5. SJ

    DataList : get values

    SJ, Sep 28, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    8,166
    =?Utf-8?B?RWx0b24gVw==?=
    Sep 29, 2005
Loading...

Share This Page