Hi @HOUSSEM MAHJOUBI ,
I wrote a demo for you, you can use it as a reference.
<form id="form1" runat="server">
<div>
<asp:DataList ID="dlCustomers" runat="server" DataSourceID="SqlDataSource1">
<ItemTemplate>
<table border="1">
<tr>
<td>EmpId:</td>
<td><asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("EmpId") %>'></asp:TextBox></td>
</tr>
<tr>
<td>EmpName:</td>
<td><asp:TextBox ID="TextBox2" runat="server" Text='<%# Eval("EmpName") %>'></asp:TextBox></td>
</tr>
<tr>
<td>EmpCity:</td>
<td><asp:TextBox ID="TextBox3" runat="server" Text='<%# Eval("EmpCity") %>'></asp:TextBox></td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString %>" SelectCommand="SELECT [EmpId], [EmpName], [EmpCity] FROM [Employee]"></asp:SqlDataSource>
</div>
</form>
I suggest you use the Label control to populated the DataList, I think it looks a little more beautiful than the textbox control.
More information about the use of DataList control you can refer to this link: DataList-control-Tutorial-with-example-in-ASPNet.aspx
Best regards,
Sam
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.