By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,976 Members | 1,139 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,976 IT Pros & Developers. It's quick & easy.

Update textbox value for auto-save

P: n/a
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

Nov 19 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"kurt" <kb****@granitemicrosystems.com> wrote in
news:11**********************@f14g2000cwb.googlegr oups.com:
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 : )
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #2

P: n/a
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

Nov 19 '05 #3

P: n/a
"kurt" <kb****@granitemicrosystems.com> wrote in
news:11**********************@g14g2000cwa.googlegr oups.com:
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!


Take a look at Javascript's setInterval():

http://msdn.microsoft.com/library/default.asp?
url=/workshop/author/dhtml/reference/methods/setinterval.asp

Here is a clock example:

http://www.webdevelopersnotes.com/ti...time_a_simple_
clock_in_javascript.php3

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #4

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

Nov 19 '05 #5

P: n/a
"kurt" <kb****@granitemicrosystems.com> wrote in
news:11**********************@g14g2000cwa.googlegr oups.com:
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.
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #6

P: n/a
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

Nov 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.