bind data to a textbox in a template column in WebForm DataGrid

J

Jodi

Hi,

I am trying to put a textbox in a template column both for displaying and
editing. When I add the following line to the HTML code
<%#DataBinder.Eval(Container.DataItem, "comments")%>
between the following lines generated by Visual Studio.NET
<ItemTemplate>
<asp:TextBox id="TextBox2" runat="server">

</asp:TextBox>
</ItemTemplate>
I got an error when switch to the design mode:
"There was an error rendering the control. Check to make sure all
properties are valid".

However, I can do the same exact thing with a Label control, which doesn't
generate an error.

Can anyone point out what I did wrong?

Many thanks,

Jodi
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top