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. Advertisements

  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. Advertisements

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. Matthew Louden
    Replies:
    1
    Views:
    7,573
    Scott M.
    Oct 11, 2003
  2. Nevyn Twyll
    Replies:
    8
    Views:
    2,304
  3. Luhar Powell via .NET 247
    Replies:
    0
    Views:
    2,573
    Luhar Powell via .NET 247
    Apr 1, 2005
  4. =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=

    Help on HTML server control vs HTML control

    =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=, Sep 15, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    2,304
    =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=
    Sep 15, 2005
  5. DKode
    Replies:
    0
    Views:
    2,171
    DKode
    Sep 26, 2005
  6. xz
    Replies:
    9
    Views:
    797
    James Kanze
    Jan 8, 2008
  7. Luhar Powell via .NET 247

    Newbie:Access custom Itemplate(not datagrid/repeater/datalist) control values on postback

    Luhar Powell via .NET 247, Apr 1, 2005, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    308
    Luhar Powell via .NET 247
    Apr 1, 2005
  8. Joe Stampf
    Replies:
    0
    Views:
    171
    Joe Stampf
    Dec 15, 2003
Loading...