How to reload on back button.

G

Guest

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
 
C

Cor Ligthert

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
 
G

Guest

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.ToFileTimeUtc().ToString());
Page.RegisterStartupScrip("OnlyNewPagesCanBeUpdated",
"<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.disabled=true;
}
var va = document.getElementsByTagName("a");
for (i=0;i<va.length;i++)
{
va.disabled=true;
va.href="#";
}
var vi = document.getElementsByTagName("img");
for (i=0;i<vi.length;i++)
{
vi.disabled=true;
}
var vt = document.getElementsByTagName("td");
for (i=0;i<vt.length;i++)
{
vt.disabled=true;

}

}
}


Does this look like a feasible solution????

regards
jcjj
 

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