Databinding within an asp:textbox control

Discussion in 'ASP .Net' started by Luis Esteban Valencia, Jan 12, 2005.

  1. am trying to databind within an asp:textbox control. I have tried many
    variations found here but nothing seems to work. It works fine if I use a
    regular HTML textbox input though. Here is what I have tried:

    <asp:textbox id='<%#DataBinder.Eval(Container.DataItem, "EmailID")%>'
    cssclass="textbox" runat="server"><%#DataBinder.Eval(Container.DataItem,
    "Email")%></asp:textbox>

    I get '<%# DataBinder.Eval(Container.DataItem, "segEmailID").ToString() %>'
    is not a valid identifier.

    Then

    <asp:textbox id="<%#DataBinder.Eval(Container.DataItem, "EmailID")%>"
    cssclass="textbox" runat="server"><%#DataBinder.Eval(Container.DataItem,
    "Email")%></asp:textbox>

    I get 'The server tag is not well formed.'

    Finally I tried without the #:

    <asp:textbox id='<%DataBinder.Eval(Container.DataItem, "EmailID")%>'
    cssclass="textbox" runat="server"><%DataBinder.Eval(Container.DataItem,
    "Email")%></asp:textbox>

    I get '<%DataBinder.Eval(Container.DataItem, "segEmailID").ToString() %>' is
    not a valid identifier.

    Thanks for your help! BTW - this asp:textbox control is within a
    repeater.....

    Thanks again!

    --
    LUIS ESTEBAN VALENCIA
    MICROSOFT DCE 3.
    MIEMBRO ACTIVO DE ALIANZADEV
    http://spaces.msn.com/members/extremed/
     
    Luis Esteban Valencia, Jan 12, 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. S. Justin Gengo
    Replies:
    0
    Views:
    580
    S. Justin Gengo
    Jul 16, 2003
  2. Darren Smith
    Replies:
    5
    Views:
    5,559
    dsmith
    May 10, 2004
  3. KatB
    Replies:
    0
    Views:
    467
  4. jobs
    Replies:
    0
    Views:
    1,776
  5. Earl Teigrob
    Replies:
    1
    Views:
    446
    Shravan
    Mar 1, 2004
Loading...

Share This Page