TextBox on ASP Page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to place a text value in a text box from a Session datable with the following
ref 1: Dim dt as DataTable = Session("userCart"
ref 2: ucUpdateCartMain.txtQty.Text = dt.Rows(i)("Quantity").ToStrin

ucUpdateCartMain is a user control with a txtQty Text Box in it

The value is given to the textbox no problem. Now when the page comes up I change the value in the textbox and do the following

ref 3: dt.Rows(i)("Quantity") = txtQty.Tex

I find that it keeps the original value from ref 2??? What's up with that? I've turned off all viewstates and still found that it's picking up the value defined in ref 2. When i remove ref 2 and ref 3 I find that the value does read what the user inputs. How can I keep ref 1 and ref 2 in the code and be able to change the value in the textbox without getting back the original value of the textbox?
 
Hi, Bryan

What I didn't see from your code is to assign datatable back to Session
Session("userCart") = d
You should do this after you update dt and before this page prerendered

Bin Song, MC
 
Back
Top