page life cycle problem

J

Jon Paal

I have a textbox in a form that saves information to a database. A linkbutton activates a function from the user's click to save
the data. A leading string of text is added to the content before saving.

I want to retrieve the saved info and have the retrieved data displayed when the page reloads.

I can't get the retrieved data to display. I can only get the old version of a previous save .

How do I save then retrieve the correct version in the postback -- any examples in vb would help
 
T

Tim Mackey

hi jon,
here is what i understand your question to be:

user enters some text, "hello" in the textbox and clicks save.
you update the database with "Preamble-" + "hello" for a record.
the page is reloaded and "hello" is still in the textbox, but you want
"Preamble-Hello" in the textbox.

if it was me, i would do a Response.Redirect(Request.Url.PathAndQuery) this
will reload the patch from scratch. i like this approach because it removes
the F5/refresh 'repost' problem if the user refreshes the page, and you have
no problems of maintaining the state of the page then.
however, a simpler approach would be to just update the value of the textbox
after your database update code, e.g.:

me.Textbox1.Text = "Preamble-Hello"

am i missing something?
tim
 

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,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top