Datalist retreiving values programatically

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?U2FuZHBvaW50R3V5?=

    Datalist retreiving values programatically

    Im maintaining an app with a DataList, the first time Ive used this control.
    A single row is retrieved from the database and formatted on the screen using
    <%# Convert.ToStrin g(DataBinder.Ev al(Container.Da taItem, "<name of
    column>")) %>
    statements in the .aspx (no controls such as button, etc)
    My problem is that I dont know how to go back into the datalist and retrieve
    one of the values in the codebehind.
    Thanks.

  • Eliyahu Goldin

    #2
    Re: Datalist retreiving values programatically

    This literal content will be represented by an instance of the
    DataBoundLitera lControl class. Once you have a reference to the item, you
    can read the text as

    (item.Controls[0] as DataBoundLitera lControl).Text

    --
    Eliyahu Goldin,
    Software Developer
    Microsoft MVP [ASP.NET]




    "SandpointG uy" <SandpointGuy@d iscussions.micr osoft.comwrote in message
    news:1768FC1C-7C11-42E5-A8BD-06EB0A5B69CF@mi crosoft.com...
    Im maintaining an app with a DataList, the first time Ive used this
    control.
    A single row is retrieved from the database and formatted on the screen
    using
    <%# Convert.ToStrin g(DataBinder.Ev al(Container.Da taItem, "<name of
    column>")) %>
    statements in the .aspx (no controls such as button, etc)
    My problem is that I dont know how to go back into the datalist and
    retrieve
    one of the values in the codebehind.
    Thanks.
    >

    Comment

    Working...