By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,152 Members | 2,039 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,152 IT Pros & Developers. It's quick & easy.

Don't show page in browser history

P: n/a
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
Jan 6 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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>

"Shimon Sim" <sh**********@community.nospam> wrote in message
news:e4***************@TK2MSFTNGP12.phx.gbl...
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

Jan 6 '06 #2

P: n/a
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.

--
Dan
"Naveen K Kohli" <na*********@hotmail.com> wrote in message
news:OY**************@TK2MSFTNGP10.phx.gbl...
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>

"Shimon Sim" <sh**********@community.nospam> wrote in message
news:e4***************@TK2MSFTNGP12.phx.gbl...
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


Jan 6 '06 #3

P: n/a


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.Se rverAndNoCache);
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
---------------------------------------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
---------------------------------------------------------------------------
It is my pleasure to be of any assistance.
Jan 6 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.