473,396 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to reload on back button.

We are building a .Net application, that is strictly transactional oriented,
ie one aspx page results in at most one mainframe transaction.

So now we need to be sure that if the user uses the backbutton to go back to
the previous (commited) transaction, the page should be rebuild from start,
and NOT just redisplayed.

Just how do you do that? META EXPIRES or????

htx in advance.
jcjj
Nov 22 '05 #1
5 2149
Jcjj

Just a thought, can you not set in a session.item what is the last active
page. Any disturbtion of that sequence should than result in a redirect to
the start page in my opinion.

Just an idea, I hope it helps?

Cor
So now we need to be sure that if the user uses the backbutton to go back to the previous (commited) transaction, the page should be rebuild from start, and NOT just redisplayed.

Just how do you do that? META EXPIRES or????

htx in advance.
jcjj

Nov 22 '05 #2
thx.

I've been thinking about your suggestion, and expanded it a little:

1. What you really want users to be able to do, is use the backbutton as
they are used to do.
2. What you really don't want users to do, is to use the data in the pages
that are recalled using backbutton for any new updates.

So what I'm going to try is create a scheme that will disable all clickable
content on the page, if it is not received directly from the IIS server.

This means including the following lines in each codebehind page:

RegisterHiddenField("pageload",DateTime.Now.ToFile TimeUtc().ToString());
Page.RegisterStartupScrip("OnlyNewPagesCanBeUpdate d",
"<script>OnlyNewPagesCanBeUpdated(); </script>");

And including a js file with the following function:

function OnlyNewPagesCanBeUpdated()
{
var kookie=0;

var allcookies = document.cookie;
var pos = allcookies.indexOf("loadkontrol=");
if (pos!=-1)
{
var start = pos+12;
var end = allcookies.indexOf(";",start);
if (end=-1) end=allcookies.length;
kookie=parseInt(allcookies.substring(start,end));
}

var loadkontrol = document.getElementsByName("pageload");
var loadkontrolParsed = parseInt(loadkontrol[0].value);

if (loadkontrolParsed>=kookie)
{
document.cookie="loadkontrol="+loadkontrol[0].value;
}
else
{
var v = document.getElementsByTagName("input");
for (i=0;i<v.length;i++)
{
v[i].disabled=true;
}
var va = document.getElementsByTagName("a");
for (i=0;i<va.length;i++)
{
va[i].disabled=true;
va[i].href="#";
}
var vi = document.getElementsByTagName("img");
for (i=0;i<vi.length;i++)
{
vi[i].disabled=true;
}
var vt = document.getElementsByTagName("td");
for (i=0;i<vt.length;i++)
{
vt[i].disabled=true;

}

}
}
Does this look like a feasible solution????

regards
jcjj
"Cor Ligthert" wrote:
Jcjj

Just a thought, can you not set in a session.item what is the last active
page. Any disturbtion of that sequence should than result in a redirect to
the start page in my opinion.

Just an idea, I hope it helps?

Cor
So now we need to be sure that if the user uses the backbutton to go back

to
the previous (commited) transaction, the page should be rebuild from

start,
and NOT just redisplayed.

Just how do you do that? META EXPIRES or????

htx in advance.
jcjj


Nov 22 '05 #3
JcJJ,

What is wrong with my idea, I stated it because as I remember me that in the
new SP from XP a lot of clientside disabling of clickable controls will be
prevented using IE 6.1

http://msdn.microsoft.com/security/d...l/xpsp2web.asp

I do not know anymore if your one is with it so check it yourself, however
you have always the change that it can be done.

Cor

Nov 22 '05 #4
thx.

I've been thinking about your suggestion, and expanded it a little:

1. What you really want users to be able to do, is use the backbutton as
they are used to do.
2. What you really don't want users to do, is to use the data in the pages
that are recalled using backbutton for any new updates.

So what I'm going to try is create a scheme that will disable all clickable
content on the page, if it is not received directly from the IIS server.

This means including the following lines in each codebehind page:

RegisterHiddenField("pageload",DateTime.Now.ToFile TimeUtc().ToString());
Page.RegisterStartupScrip("OnlyNewPagesCanBeUpdate d",
"<script>OnlyNewPagesCanBeUpdated(); </script>");

And including a js file with the following function:

function OnlyNewPagesCanBeUpdated()
{
var kookie=0;

var allcookies = document.cookie;
var pos = allcookies.indexOf("loadkontrol=");
if (pos!=-1)
{
var start = pos+12;
var end = allcookies.indexOf(";",start);
if (end=-1) end=allcookies.length;
kookie=parseInt(allcookies.substring(start,end));
}

var loadkontrol = document.getElementsByName("pageload");
var loadkontrolParsed = parseInt(loadkontrol[0].value);

if (loadkontrolParsed>=kookie)
{
document.cookie="loadkontrol="+loadkontrol[0].value;
}
else
{
var v = document.getElementsByTagName("input");
for (i=0;i<v.length;i++)
{
v[i].disabled=true;
}
var va = document.getElementsByTagName("a");
for (i=0;i<va.length;i++)
{
va[i].disabled=true;
va[i].href="#";
}
var vi = document.getElementsByTagName("img");
for (i=0;i<vi.length;i++)
{
vi[i].disabled=true;
}
var vt = document.getElementsByTagName("td");
for (i=0;i<vt.length;i++)
{
vt[i].disabled=true;

}

}
}
Does this look like a feasible solution????

regards
jcjj
"Cor Ligthert" wrote:
Jcjj

Just a thought, can you not set in a session.item what is the last active
page. Any disturbtion of that sequence should than result in a redirect to
the start page in my opinion.

Just an idea, I hope it helps?

Cor
So now we need to be sure that if the user uses the backbutton to go back

to
the previous (commited) transaction, the page should be rebuild from

start,
and NOT just redisplayed.

Just how do you do that? META EXPIRES or????

htx in advance.
jcjj


Nov 22 '05 #5
JcJJ,

What is wrong with my idea, I stated it because as I remember me that in the
new SP from XP a lot of clientside disabling of clickable controls will be
prevented using IE 6.1

http://msdn.microsoft.com/security/d...l/xpsp2web.asp

I do not know anymore if your one is with it so check it yourself, however
you have always the change that it can be done.

Cor

Nov 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kim Therkelsen | last post by:
Hi! By pressing a button I am directed from one page to another. At the second page some things displayed on the first page are changed and now I want to go back to the first page again. The...
0
by: cycloneboy | last post by:
When I call a crystal report via a hyperlink the report runs great. If I click the BACK button on the browser and then click the hyperlink to call the report again I get...
19
by: Darren | last post by:
I have a page that opens a popup window and within the window, some databse info is submitted and the window closes. It then refreshes the original window using window.opener.location.reload(). ...
6
by: Stefan Mueller | last post by:
After my web page has been loaded I'm doing some tests with a JavaScript. If I figure out that something is wrong I'd like to reload the whole frameset. With Internet Explorer and Mozilla Firefox...
3
by: UJ | last post by:
Is there any way I can have a page reload itself where it will completely reload from scratch. I have a condition where a person click a button and the easiest way to handle it would be to have the...
7
by: Schmidty | last post by:
Okay...I have another 'newbie' question; I have a function that loads a page and the action is $_SERVER; In the form that is in a function(method?) within a class a variable is passed back to...
3
by: Stef Mientki | last post by:
hello, I've a graphical application (wxPython), where the code in the main GUI loop is given below. 1 JAL_Loaded = False 2 while len(App_Running) 0: 3 if JALsPy_globals.State...
1
by: Rob | last post by:
I know this is an old one, considering how many posts I found on it but I just wondered if any best practises had popped up recently, especially as Ajax has increased JavaScript and DHTML's...
2
by: ramanaths | last post by:
Hi I have a page that shows many thumbnail images. on load of this page i have some code that invokes a javascript which shows a message saying 'loading images'... this is hidden once all the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.