Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

textbox states with ajax anyone?

0 views
Skip to first unread message

Max

unread,
May 6, 2008, 11:11:02 AM5/6/08
to
I tried the following with Web Dev 2008 with -and- without Ajax Extension
3.5 - using IE 7
I reduced my webform1 to a Scriptmanager and an Updatepanel with 2 textbox
and a button. I type something in textbox1, press the button and a function
runs and completes textbox2.
Then I hyperlink to webform2, come back, and not only textbox2 is blank (one
can thinks it was dynamically updated...) but also textbox1 is empty !

What mistake I'm doing? this behaviour is evidently not possible
Thanks Max


Eliyahu Goldin

unread,
May 6, 2008, 11:27:32 AM5/6/08
to
When you navigate to webform2, webform1's gone. When you come back to it,
the server loads it again. You need to set the values in the Page_Load
event.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"Max" <mm> wrote in message
news:48207507$0$41660$4faf...@reader4.news.tin.it...

Max

unread,
May 6, 2008, 12:12:32 PM5/6/08
to
I mean coming back to webform1 with the browser back button. I expect to
find what I left, or at least what I typed.


"Eliyahu Goldin" <REMOVEALLCAPIT...@mMvVpPsS.org> ha scritto nel
messaggio news:umW3j34r...@TK2MSFTNGP02.phx.gbl...

Eliyahu Goldin

unread,
May 6, 2008, 2:43:53 PM5/6/08
to
Try the same with some commercial sites. You will see that although some
search-oriented sites like Google and Answers.com do preserve your typing,
it is rather an exception. Most pages load in a regular way on hitting the
Back.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin

"Max" <mm> wrote in message

news:4820836f$0$29594$4faf...@reader1.news.tin.it...

bruce barker

unread,
May 6, 2008, 5:59:01 PM5/6/08
to
when the browser navigates a to a page in the cache, it loads it from the
original cache image, any updates to the dom done by javascript are not
saved so will not appear by back navigation.

to get around this limitation most ajax libraries have some sort of history
support. for asp.net in in the futures extensions. you will need to write
javascript to support this (usually an ajax call to the server to get context
info on a nav back).

this is actually fairly a complex to do corectly, so you should read
serveral articles about browser history, bookmarks and ajax calls before
tackling.


-- bruce (sqlwork.com)

Max

unread,
May 7, 2008, 1:21:14 PM5/7/08
to
Bruce,
indeed the last Ajax extension implements history management, but it doesn't
apply to multi-page. That is, if you change webform, history points are lost
even if you come back, and this is a huge limitation in my opinion.
So "an ajax call to the server to get context info on a nav back" works
only on the same page at the current state of the art.
I'd like to intercept a "browser back button pressed" javascript event, but
I can't.
If I get webform1 by pressing back button, how can I detect that in
javascript? Or, what javascript event is thrown when getting webform1 in any
way, even with back button?


"bruce barker" <bruce...@discussions.microsoft.com> ha scritto nel
messaggio news:B97EEDDB-4883-457F...@microsoft.com...

0 new messages