codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Accessing TextBox inside a Repeater  LOLLA at 08:54 on Wednesday, September 24, 2003
 

Hi

I have a repeater with a textbox inside it, I need to update my table with the value in this textbox, the problem is that i can't refer to these textboxes, I tried to use a non constant ID for the textBox as in the following Code:


<asp:Repeater id="repContact" runat="server">
<ItemTemplate>
<asp:textbox name='txtContactInfo_"<%# Container.DataItem("CategoryID")%>"' runat="server" />
</ItemTemplate> </asp:Repeater>

Code behind:
Dim newtb As TextBox = new TextBox()
strSQL = "Select CategoryID " _
& "From ContactInfo " _
& "Where CategoryID = " & iID

myCommand = New OleDbCommand (strSQL, objConn)
dataReader = myCommand.ExecuteReader()

Do While dataReader.Read()
newtextboxname = ("CategoryID")
newtb.ID = "txtContactInfo_" + newtextboxname

Dim myComm As OleDbCommand = New OleDbCommand (strSQL,dbConn)
strSQL = "Update ContactInfo " _
& "Set ContactInfo = '" & newtb.Text.Trim() & "' " _
& "Where CategoryID = " & iID

myComm.CommandText = strSQL

myComm.ExecuteNonQuery()

myComm.Cancel()
Loop
dataReader.Close()

What is the problem with this code?, i wonder if the problem was in defining the textbox ID.

Thanks for helping











CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Date script issues
•  perl script help needed
•  onChange issue
•  perl remote execution
•  Chat application
•  How to send multiple perameters in SOAP request.
•  Java code for Insert picture on the table in spreadsheet
•  Re: Problem with concatenation
•  how to genrates the crystal report by sending a id at runtime


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007