|
 |
asp_databases thread: How to refresh a page automatically
Message #1 by "ozgen" <bk_mandyt@d...> on Sun, 18 Aug 2002 02:03:40
|
|
I've got a page which allow user to change his/her profile. I use session
("FirstName"), session("LastName") and etc to store all information. When
the user login the system first time and want to change his profile, it's
totally correct to display all user's information. But when I use
the "back" button to back to the login page and use other user name to
login the system and once again want to change the profile. The
information is not updated. This means, the page is still displaying the
former user's information. I know that all the session variables are
already updated, but failed to display except I click the refresh button
to refresh the page.
More information:
When the user sucessfully login the system, the system will redirect it to
a main page. And the main page is divided by 3 frames, top, left and main.
There are some buttons on the top frames, if the user want to change his
profile. Just click one of these button and the page for updating user
profile will be loaded in the main frame. And I used this to call the
session variable out:
<input type="text" name="FirstName" value="<% = session("FirstName") %>"
size="40">
So, how can I refresh the page without clicking the refresh button?
Thank you so much.
Message #2 by "Ben Smith" <ben@b...> on Sun, 18 Aug 2002 10:51:51 +0100
|
|
Hi
Couldn't you add some non-caching controls to the page? That should make
sure that the "old" session variable isn't used.
'---------------------------------------
Response.Expires = -1
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
'---------------------------------------
You could also add some JavaScript to refresh the page if it's being viewed
for the first time. Put the following in your <body> somewhere:
<%
If Request.Querystring("reloaded") <> Yes Then
%>
<script language="JavaScript">
window.location.replace('youpagehere.asp?reloaded=Yes')
</script>
<%
End If
%>
Hope that helps,
Ben Smith
ben@b...
-----Original Message-----
From: ozgen [mailto:bk_mandyt@d...]
Sent: 18 August 2002 02:04
To: ASP Databases
Subject: [asp_databases] How to refresh a page automatically
I've got a page which allow user to change his/her profile. I use session
("FirstName"), session("LastName") and etc to store all information. When
the user login the system first time and want to change his profile, it's
totally correct to display all user's information. But when I use
the "back" button to back to the login page and use other user name to
login the system and once again want to change the profile. The
information is not updated. This means, the page is still displaying the
former user's information. I know that all the session variables are
already updated, but failed to display except I click the refresh button
to refresh the page.
More information:
When the user sucessfully login the system, the system will redirect it to
a main page. And the main page is divided by 3 frames, top, left and main.
There are some buttons on the top frames, if the user want to change his
profile. Just click one of these button and the page for updating user
profile will be loaded in the main frame. And I used this to call the
session variable out:
<input type="text" name="FirstName" value="<% = session("FirstName") %>"
size="40">
So, how can I refresh the page without clicking the refresh button?
Thank you so much.
Message #3 by "ozgen" <bk_mandyt@d...> on Sun, 18 Aug 2002 22:07:00
|
|
Thank you so much. I copied your codes in mine, it works!!! Thanks
> I've got a page which allow user to change his/her profile. I use session
(> "FirstName"), session("LastName") and etc to store all information.
When
t> he user login the system first time and want to change his profile,
it's
t> otally correct to display all user's information. But when I use
t> he "back" button to back to the login page and use other user name to
l> ogin the system and once again want to change the profile. The
i> nformation is not updated. This means, the page is still displaying the
f> ormer user's information. I know that all the session variables are
a> lready updated, but failed to display except I click the refresh button
t> o refresh the page.
>
M> ore information:
W> hen the user sucessfully login the system, the system will redirect it
to
a> main page. And the main page is divided by 3 frames, top, left and
main.
T> here are some buttons on the top frames, if the user want to change his
p> rofile. Just click one of these button and the page for updating user
p> rofile will be loaded in the main frame. And I used this to call the
s> ession variable out:
> <input type="text" name="FirstName" value="<% = session("FirstName") %>"
s> ize="40">
> So, how can I refresh the page without clicking the refresh button?
> Thank you so much.
|
|
 |