如何在DataList的中加入TextBox控件并在初始时显示数据,在线等!!
源代码:
<body MS_POSITIONING="GridLayout">
<form runat="server" ID="Form1">
<asp:DataList id="DataList1" runat="server" BorderColor="black" BorderWidth="2px" Font-Name="Verdana" Font-Size="8pt" GridLines="Both" AlternatingItemStyle-BackColor="Gainsboro">
<HeaderTemplate>
<table>
<tr style="background-color:lightblue;font-size:12px">
<td width="100" align="center">书籍编号</td>
<td width="100" align="center">书名</td>
<td width="100" align="center">价格</td>
<td width="100" align="center">类别</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table>
<tr style="font-size:11px">
<td width="100" align="center"><%# DataBinder.Eval(Container.DataItem, "title_id") %></td>
<td width="100" align="center"><%# DataBinder.Eval(Container.DataItem, "title") %></td>
<td width="100" align="center"><%# DataBinder.Eval(Container.DataItem, "price","{0:c}") %></td>
<td width="100" align="center"><!--关键是这里无法显示-->
<input type="text" runat="server" value=<%# DataBinder.Eval(Container.DataItem, "type") %>ID="Text1" NAME="Text1">
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
<DIV style="DISPLAY: inline; Z-INDEX: 101; LEFT: 234px; WIDTH: 180px; POSITION: absolute; TOP: 287px; HEIGHT: 18px" ms_positioning="FlowLayout">Label</DIV>
</form>
</body>