Textbox update
-
I am having a problem with the textbox controls in my page. When the page loads I initialize the text boxes with data retrieved from a database.
Page_Load()
{
for i = 1 to 5
Dim tmpTextBox As TextBox = FindControl( "txtBox" & i )
tmpTextBox.Text = Session("txtBox" & i )
next i
}The user can modify the contents of the text boxes so when they click submit I update the Session variables by grabbing the "new" data typed in the text boxes.
OnSubmit()
{
If Page.IsValid then
Dim i As Integer
For i = 1 to 5
Session("txtBox" & i) = (CType( FindControl( "txtBox" & i), TextBox )).Text
Next i
Response.Redirect("NextPage.aspx")
End if
}It turns out that the txtBox.Text (all of them actually) retains its old value (the one that I initialized it with). If I type new text, I cannot retrieve it. I have RequiredFieldValidator linked to those text boxes and I am not sure if that has anything to do with it. Does anyone have any suggestions about this because I have ran out of options? Thank you. Time is the fire in which we burn.
-
I am having a problem with the textbox controls in my page. When the page loads I initialize the text boxes with data retrieved from a database.
Page_Load()
{
for i = 1 to 5
Dim tmpTextBox As TextBox = FindControl( "txtBox" & i )
tmpTextBox.Text = Session("txtBox" & i )
next i
}The user can modify the contents of the text boxes so when they click submit I update the Session variables by grabbing the "new" data typed in the text boxes.
OnSubmit()
{
If Page.IsValid then
Dim i As Integer
For i = 1 to 5
Session("txtBox" & i) = (CType( FindControl( "txtBox" & i), TextBox )).Text
Next i
Response.Redirect("NextPage.aspx")
End if
}It turns out that the txtBox.Text (all of them actually) retains its old value (the one that I initialized it with). If I type new text, I cannot retrieve it. I have RequiredFieldValidator linked to those text boxes and I am not sure if that has anything to do with it. Does anyone have any suggestions about this because I have ran out of options? Thank you. Time is the fire in which we burn.