page life cycle problem

  • Thread starter Thread starter Jon Paal
  • Start date Start date
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
 
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
 
Back
Top