Hi
I am missing something
On a web form I have a repeater control. I've set it up to be data bound to 2 columns from my data source, to a label and a text box respectively, and at run time under page load, I do the data binding.
There is a submit button, and when the user presses this, I want the new values of the text boxes to be passed to a procedure. The problem is that the original values are being passed, even though in the repeater 'HTML', viewstate is turned on.
A seperate text box on the form is behaving normally.
Anyone any ideas
Here is the HTML bit
<asp:Repeater id="repPartsUsed" runat="server">
<ItemTemplate>
</ItemTemplate>
<ItemTemplate>
<li>
<asp:Label Runat=server text='<%#dr("Info"%>' EnableViewState=True>
</asp:Label>
<asp:TextBox Runat=server Text='<%#dr("Parts_Used"%>' EnableViewState=True>
</asp:TextBox>
</li>
</ItemTemplate>
</asp:Repeater>
Here is the bit which binds it on page load
Dim cmdGetPartsUsed As New OleDbCommand()
cmdGetPartsUsed.Connection = Conn
cmdGetPartsUsed.CommandType = CommandType.Text
cmdGetPartsUsed.CommandText = "Select * from v_parts_used_by_entry where entry_id = " & Request.QueryString("EntryID"
'Stop
Conn.Open()
dr = cmdGetPartsUsed.ExecuteReader
repPartsUsed.DataSource = dr
repPartsUsed.DataBind()
dr.Close()
Conn.Close()
And here is the bit where I try to get the new values
Dim repItem As RepeaterItem
For Each repItem In repPartsUsed.Items
Dim thisLabel As Label
Dim thisTextBox As TextBox
thisLabel = CType(repItem.Controls(1), Label)
thisTextBox = CType(repItem.Controls(3), TextBox)
Debug.WriteLine("Part Id = " & thisLabel.Text & vbTab & "Quantity = " & thisTextBox.Text)
Next
Debug.WriteLine("The test text box = " & txtTest.Text)
The txtTest works correctly, but thisTextBox prints the old values
Thanks in advance
Mark
I am missing something
On a web form I have a repeater control. I've set it up to be data bound to 2 columns from my data source, to a label and a text box respectively, and at run time under page load, I do the data binding.
There is a submit button, and when the user presses this, I want the new values of the text boxes to be passed to a procedure. The problem is that the original values are being passed, even though in the repeater 'HTML', viewstate is turned on.
A seperate text box on the form is behaving normally.
Anyone any ideas
Here is the HTML bit
<asp:Repeater id="repPartsUsed" runat="server">
<ItemTemplate>
</ItemTemplate>
<ItemTemplate>
<li>
<asp:Label Runat=server text='<%#dr("Info"%>' EnableViewState=True>
</asp:Label>
<asp:TextBox Runat=server Text='<%#dr("Parts_Used"%>' EnableViewState=True>
</asp:TextBox>
</li>
</ItemTemplate>
</asp:Repeater>
Here is the bit which binds it on page load
Dim cmdGetPartsUsed As New OleDbCommand()
cmdGetPartsUsed.Connection = Conn
cmdGetPartsUsed.CommandType = CommandType.Text
cmdGetPartsUsed.CommandText = "Select * from v_parts_used_by_entry where entry_id = " & Request.QueryString("EntryID"
'Stop
Conn.Open()
dr = cmdGetPartsUsed.ExecuteReader
repPartsUsed.DataSource = dr
repPartsUsed.DataBind()
dr.Close()
Conn.Close()
And here is the bit where I try to get the new values
Dim repItem As RepeaterItem
For Each repItem In repPartsUsed.Items
Dim thisLabel As Label
Dim thisTextBox As TextBox
thisLabel = CType(repItem.Controls(1), Label)
thisTextBox = CType(repItem.Controls(3), TextBox)
Debug.WriteLine("Part Id = " & thisLabel.Text & vbTab & "Quantity = " & thisTextBox.Text)
Next
Debug.WriteLine("The test text box = " & txtTest.Text)
The txtTest works correctly, but thisTextBox prints the old values
Thanks in advance
Mark