I am trying to databind fields in a formview from the codebehind. If I were to do it in the front end, it would be something like:
<asp:TextBox id="txtField" runat="server" text='<%# Bind("col_name") %>' />
and col_name would be present in the select and update commands of the sqlDataSource bound to the parent FormView that the textbox is in.
As the form is generated dynamically in the codebehind, I can't use the <%# Bind() %> syntax. How can I bind the textbox from the codebehind? If I can't, what is the best solution to this?