Do you always have to declare objects in form?

Dissedatt

New Member
I am useing a DataReader to populate a table with information from the DB. In the last row I am creating a Form with a Visible="False" Textbox and want to write out the value of the ID field. <BR><BR>The DataReader works fine until you try to write out the value in a TextBox within a Form. It tells me "Name 'strDBID' is not declared" even if I declare strDBID as a String inside of the Form. <BR><BR>(ex: <asp:TextBox ID="strDBID Visible="False" Runat="Server"><%=objReader.Item("ID")%></asp:TextBox><BR><BR>Thanks!Hi Caver,<BR><BR>You are missing a " in your ex:.... -> "strDBID"<BR><BR>Maybe you should do this:<BR><BR>Dim txt as New TextBox<BR>txt = Me.FindControl("strDBID")<BR>Response.Write(txt.Text)<BR><BR>Hope it solves your problem, good luck,<BR><BR>Ultima<BR>
 
Back
Top