954,577 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

asp Textbox retrieval issue.

I am currently working on a project where I want to allow a customer to update their details through a web interface. I am using C# codebehind. On page load I am setting the values of the textbox using the existing customers details.

The idea being, the user sees the textbox with the existing details and can make changes and click submit.

On the submit button click I have C# code which I am attempting to retrieve the changed value from the textbox control. However the textbox control seems not to have updated itself, as the value (from the textbox control) is still the existing value.

This is the code I am using on the button click event.

patient.Firstname = txtFirstname.Text.Trim();


Any help and pointers would be much appreciated.

Doops
Newbie Poster
7 posts since Mar 2006
Reputation Points: 10
Solved Threads: 0
 

Yo dude , you will have to give some clearer details...

Does the textbox not display the new value or does it not update the database ??

cVz
Junior Poster
140 posts since Mar 2008
Reputation Points: 29
Solved Threads: 7
 

Hey thanks,

I'm not concerned with database access here, I am using a webservice to handle that part. I simply want to retrieve the value from the textbox.

For example, on load, I will change a textbox to hold the customers name, say "John". Then the user changes that value to "James" and clicks submit. On the submit button click event I want to retrieve the new value ("James") from the textbox. But when put a breakpoint in and look at the textbox text value it still holds "John".

Cheers

Doops
Newbie Poster
7 posts since Mar 2006
Reputation Points: 10
Solved Threads: 0
 

I have managed to solve the problem. I did not realise that when the submit button was clicked, the postback reloads the form. This caused my setup method to run and populate the textbox with the old information.

Sorry, this wasn't a technical issue, just my incompetence!!

Doops
Newbie Poster
7 posts since Mar 2006
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You