how to bind text box

S

San

Text box doesn't have 'DataSource' property. Is there any
way where I can bind the text box to a data source field.?
Basically I wish to render the text box control
using 'TemplateColumn' and want to bind this text box to
the datafield.
Thanks
 
T

Teemu Keiski

TextBox's Text property is the key thing because TextBox can't be bound
repeatedly like DataGrid or DataList etc. Single TextBox can be bound to
single value and that happens via Text property

....
<ItemTemplate>
<asp:TextBox ID="myTextBox" runat="server"
Text='<%#DataBinder.Eval(Container.DataItem,"field")%>' />
<ItemTemplate>
....

--
Teemu Keiski
MCP,Designer/Developer
Mansoft tietotekniikka Oy
http://www.mansoft.fi

ASP.NET Forums Moderator, www.asp.net
AspAlliance Columnist, www.aspalliance.com

Email:
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top