Don't show page in browser history

S

Shimon Sim

Hi
Is it possible to make sure that the page doesn't show in browser history
and won't effect Back button.
The problem is that every postback shows as another entry for "Back" button
and user goes through the hole history of postbacks if she wants to get to
previous page.
Thank you,
Shimon
 
N

Naveen K Kohli

IF you don't want user to access the page by BACK button, then best would be
to disable CACHING of pages by client browser by adding prope meta tags on
pages. You can try the following JS on each page and it should disable
ability to use BACK button.

<script language="javascript">
window.history.forward(1);
</script>
 
D

Dan

No he means that say he had page A and on there had a update button for
example and pressed it 3 times, thats 3 postbacks.

When he presses back he has to press back 4 times (to get past the 3
postbacks) in order to get to the original page.

I actually have the same annoying problem, i am sure there is a workaround,
their must be. I think the smartnav directive may solve it (tho it is not
crossbrowser but i think some peopl ehave made their own that is) or you
could make your own back button and store the original page that started the
chain as the target, combine that with the javascript from the previous post
and they will have to use your back button.
 
W

Wei-Dong XU [MS]

Hi Shimon,

I assume you are using ASP.net 2.0. My suggestion is that we could place
the code at the page to make it expire immediately. This way, when the user
wanna click the back button at IE, it will report one page expire error
message. Then he will have to focus on your page for the navigation. The
sample code is:
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache);
Response.Cache.SetExpires(DateTime.Now.AddDays(-10));
}

Please feel free to let me know if you have any further question on this
issue.

Best Regards,
Wei-Dong XU
Microsoft Support
 

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

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top