Update textbox value for auto-save

K

kurt

Hi all,

I have something that has me stumped. I have a webform that has several
text boxes. Each of these boxes has the textchanged set so when the
user enters text and leaves the textbox, it runs through and updates
the table with the changed text....which is fine.

But, these users do enter a substantial amount of information in these
textboxes and at times get sidetracked. Sometimes, they come back later
to see the session expired and they can no longer save the information
they entered in the textbox (in this case, they stayed in the same
textbox and textchanged didn't happen). I don't want to keep the
sessions running for a rediculous amount of time for a variety of
reasons, so it does timeout within a reasonable period.

What I would like to do is a type of 'autosave' where it gets sent to
the sub that saves the text and updates the table.

However, when when I try to send it to the Save sub and update through
code...like say from a timer a minute before the session expiration,
the value of the textboxes do not contain any added or changed text. If
I check the value of Text1.text, it will contain 'pre-changed' text.
But, if the user was to click a Save button, the actual text that is
showing in the textbox will be saved. So that way it actually grabs the
current text in the textbox.

Is there a way to update text1.text (or any textbox) to what actually
is entered in the textbox so it can be autosaved? I don't think there
would be a problem in a Windows form, but I'm not using that. I've
tried several things like trying to send it back through Page_Load and
the like, but it's still being stubborn. Is this possible? Thanks for
any help!!!


Kurt
 
L

Lucas Tam

What I would like to do is a type of 'autosave' where it gets sent to
the sub that saves the text and updates the table.

In ASP.NET 2.0 you could use client-side postbacks for this. For ASP.NET
1.1, you can use Dart's live controls or AshleyIT's Javascript Remoting.

Here's a .NET implementation of AshleyIT's Javascript remoting:

http://www.thycotic.com/dotnet_remotescripting.html

Basically what you do is set a Javascript timer on the client side to
postback information in the background to save. The page will not reload
and the user will not know that the information has been saved - totally
seemless autosave : )
 
K

kurt

Thanks very much for your reply Lucas.

When you mentioned using a JavaScript timer to postback information, do
you have any ideas on one? I've been doing some searching and can't
find anything that looks to do what I need. Thanks again!

Kurt
 
L

Lucas Tam

K

kurt

Lucas,
Thanks a lot for your help. I used a JavaScript timer and the
__doPostBack and it worked great!!


Kurt
 
L

Lucas Tam

Lucas,
Thanks a lot for your help. I used a JavaScript timer and the
__doPostBack and it worked great!!


I guess that would work too :) Might catch your users a bit off guard, but
better than not saving.
 
K

kurt

Yeh, but I'd rather them see something happen than have them wander off
or take a phone call and come back to an expired session after entering
a lot of information. It's happened several times and these folks
aren't the happiest of campers. So yeh, you're right....it's better
than not having it saved! Thanks again Lucas!

Kurt
 

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

Top