Hi,
When you say binding an incoming datatable to a textbox, do you mean
binding a specific row's column value of the datatable?
Incase you need to bind the textbox to a specific row's cell value, then
probably you could try this option:
<input type="text" id="txtcon" value="<%= dt.Rows[0][0]%>" />
But then, if you need an asp:textbox to be bound through your html code, in
that case, the asp:textbox needs to be supported with another hidden input
textbox, followed by a script.
<input type="text" id="txtcon"
style="DISPLAY:none;"
value="<%= dt.Rows[0][0]%>" />
<asp:TextBox ID="txtContent" runat="Server"></asp:TextBox>
<script type="text/javascript">
document.getElementById("txtContent").value =
document.getElementById("txtcon").value
</script>
This code will be useful if you specifically want to bind in the html source
itself.
But if that is not mandatory, the same can be achived by simply assigning
the text property of the asp:textbox to the particular field value of the
datatable.
Also, the textbox can be bound to only 1 cell value of the entire datatable
at a time.
I hope this helps.
-Parvathy.