TextBox on ASP Page

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?
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,273
Latest member
DamonShoem

Latest Threads

Top