Hi Vishnu
Thanks for responding. I have controls already named txtQlLink1, txtQLLink2
etc in the .aspx form. I created those controls by dragging and dropping them
on to the form first. Now, I'm trying to reload the page with values
retrieved from the database but doing it in a loop instead of having to do it
for each control.
This is the code that is used to set the code to the text conrols:
For Each arrValueQL As String In arrQC
qlCount = qlCount + 1
If arrValueQL <> "" Then
If (qlCount Mod 2) = 1 Then
Dim txtQLLink As New TextBox
txtQLLink.ID = "txtQLLink" & i.ToString
txtQLLink.Text = arrValueQL
Me.FindControl("Form1").Controls.Add(txtQLLink)
ElseIf (qlCount Mod 2) = 0 Then
Dim txtQLUrl As New TextBox
txtQLUrl.ID = "txtQLUrl" & i.ToString
txtQLUrl.Text = arrValueQL
Me.FindControl("Form1").Controls.Add(txtQLUrl)
i = i + 1
End If
End If
Next
"Vishnu-Chivukula" wrote:
Hi Varad,
"Multiple controls with the same ID 'txtQLLink1' were found".
This means that you were not able to assign unique IDs to controls in your
page. Check whether the loop in which you are re-creating the controls, you
are also incrementing the index value for the control. This will ensure that
they get unique names like txtQLLink1, txtQLLink2, txtQLLink3 ...
If this is working fine, then you must be having some other textbox with the
same ID.
HTH,
Need any help, do post a msg back..
Happy Coding
"Varad" wrote:
Hi all
Pls give me some insight as to what I should be doing.
I have a form where I have 20 text boxes and when an user submits the form I
save it to a database. When they want to retrieve it, I loop and create the
textboxes with ID and text value and then add to the form. The problem is
when trying to create the control in the code behind page I get the error
"Multiple controls with the same ID 'txtQLLink1' were found".
How do I retrieve the data and display it in the text boxes in the form?
Thanks
V