page life cycle problem

Discussion in 'ASP .Net' started by Jon Paal, Jan 19, 2007.

  1. Jon   Paal

    Jon Paal Guest

    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
    Jon Paal, Jan 19, 2007
    #1
    1. Advertising

  2. Jon   Paal

    Tim Mackey Guest

    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

    "Jon Paal" <Jon[ nospam ]Paal @ everywhere dot com> wrote in message
    news:...
    >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
    >
    >
    >
    >
    >
    >
    Tim Mackey, Jan 22, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Rilling
    Replies:
    5
    Views:
    349
    Peter Rilling
    Mar 9, 2005
  2. Guest
    Replies:
    3
    Views:
    2,776
    Bruce Barker
    Sep 6, 2005
  3. Fred
    Replies:
    5
    Views:
    6,232
    Karl Seguin [MVP]
    Jan 23, 2006
  4. lander
    Replies:
    5
    Views:
    2,521
    Mark Rae [MVP]
    Mar 3, 2008
  5. Gary Larimer

    Page life cycle and Page.IsValid property

    Gary Larimer, Jul 30, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    378
    Gary Larimer
    Aug 1, 2008
Loading...

Share This Page