By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,515 Members | 1,363 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,515 IT Pros & Developers. It's quick & easy.

Databinding within an asp:textbox control

P: n/a

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.DataIt em,
"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.DataIt em,
"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.DataIte m,
"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/
Nov 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.