Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > page life cycle problem

Reply
Thread Tools

page life cycle problem

 
 
Jon Paal
Guest
Posts: n/a
 
      01-19-2007
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






 
Reply With Quote
 
 
 
 
Tim Mackey
Guest
Posts: n/a
 
      01-22-2007
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
>
>
>
>
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Page life cycle and Page.IsValid property Gary Larimer ASP .Net 2 08-01-2008 10:57 PM
What does "Page Load" and "Page Unload", "Page Life Cycle" exactlymean???? lander ASP .Net 5 03-03-2008 02:06 PM
Code render blocks: When rendered in asp.net page life cycle ASP .Net 3 09-06-2005 06:04 PM
How to avoid two DB calls during page life cycle. Peter Rilling ASP .Net 5 03-09-2005 06:48 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57