Browser Back Button

D

DotNetGruven

How are people handling the browser back button on database driven web apps
built using ASP.NET??

We keep state in Session and the back button is causing us lots of head
aches!

Is this just a situation where we should look harder at the way we use
Session State or are their tricks and/or tips on this?

TIA
George
 
S

Steve C. Orr [MVP, MCSD]

There is only one easy solution that I know of, and it's not practical in
every situation:
If you open a new browser window it will have no history, thus the back
button will be disabled.
 
S

Scott M.

The functionality of the Back button is not controllable. It is part of the
client. The best you can do is expire your page content, but there is
nothing you can do to disable the back button.
 
G

Guest

I'd look hard at the design. What are the headaches? If you do need to
control where "back" takes them, you can look at the js function
location.replace(). Or, you might set a session variable so you can know not
to execute a submit the second time around. Hard to know without more detail.

Bill
 
G

Guest

Well u can disable it with Jscript by doing:-
javascript:window.history.forward(1);
 
S

Scott M.

That doesn't disable the Back button. In fact, it will cause problems if
the user has already hit the back button prior to arriving at the page in
question.
 
N

naija naija

Hi Scott,
Yeah thanks alot for the advice.
But that was my quick solution.
Do you have any good way to do that?
Patrick
 
S

Scott M.

By setting this value on a web page, you are indicating to the server that
the page content is no longer valid. The page content will expire
immediately. You can't disable the Back button, but if the page content has
expired, when the user does hit the back button, the client will display
"Page Expired" instead of the page.
 

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

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top