access html control in datalist

Discussion in 'ASP .Net' started by =?Utf-8?B?emlubw==?=, Jun 2, 2005.

  1. is there a way to access an HTML control embeded inside a datalist ?
    I need to format the datalist depends on specific condition while databinding
    ( on ItemDataBound)

    <datalist runat=server>
    <itemTemplate>
    <input type=text value='<%#
    CType(Container.DataItem,System.Data.DataRowView)("myValue") %>' id=myControl>
    </itemTemplate>
    </datalist>

    thanks for help
    =?Utf-8?B?emlubw==?=, Jun 2, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?emlubw==?=

    Karl Seguin Guest

    well, you need to add a runat="Server" at which point you can access it via
    dim mycontrol as HtmlTextInput = ctype(e.Item.FindControls("myControl"),
    HtmlTextInput)

    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/ - New and Improved (yes, the popup is
    annoying)
    http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
    come!)
    "zino" <> wrote in message
    news:...
    > is there a way to access an HTML control embeded inside a datalist ?
    > I need to format the datalist depends on specific condition while
    > databinding
    > ( on ItemDataBound)
    >
    > <datalist runat=server>
    > <itemTemplate>
    > <input type=text value='<%#
    > CType(Container.DataItem,System.Data.DataRowView)("myValue") %>'
    > id=myControl>
    > </itemTemplate>
    > </datalist>
    >
    > thanks for help
    Karl Seguin, Jun 2, 2005
    #2
    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:
    398
    Gönen EREN
    Aug 22, 2003
  2. Matthew Louden
    Replies:
    1
    Views:
    6,891
    Scott M.
    Oct 11, 2003
  3. acko bogicevic

    DataList in DataList

    acko bogicevic, Nov 10, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    5,499
    acko bogicevic
    Nov 11, 2003
  4. Steve Lloyd
    Replies:
    1
    Views:
    687
    Rick Spiewak
    May 26, 2004
  5. Nevyn Twyll
    Replies:
    8
    Views:
    1,848
Loading...

Share This Page