473,564 Members | 2,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Back button issue

Hi,
Every time I write ASP.NET application I have the same problem - Back button
on the browser is my enemy. I have to tell client avoid using "Back" button
and if you use it make sure to refresh the page to latest information.

I decided to pay information to application on the web and I see that some
sites don't have those issues. Like I used some forum site that uses PERL
(files with ext. pl) and Back button from browser gets new updated page
everytime.
Can I do anything about this in ASP.NET?
Thanks,
Shimon.
Nov 19 '05 #1
8 6126
Your page_load is rewriting the page each time you enter because you do not
have your code trap within the following:

If NOT IsPostBack then

End If

"Shimon Sim" <es*****@att.ne t> wrote in message
news:OR******** ******@TK2MSFTN GP10.phx.gbl...
Hi,
Every time I write ASP.NET application I have the same problem - Back
button on the browser is my enemy. I have to tell client avoid using
"Back" button and if you use it make sure to refresh the page to latest
information.

I decided to pay information to application on the web and I see that some
sites don't have those issues. Like I used some forum site that uses PERL
(files with ext. pl) and Back button from browser gets new updated page
everytime.
Can I do anything about this in ASP.NET?
Thanks,
Shimon.

Nov 19 '05 #2
Sorry.
But you totally misunderstood the problem. I always check IsPostBack. It is
not the point.
The problem is what happens when user clicks on the "Back" button on the
browser. What I usually get is the old cashed on the client page that needs
to be refreshed to get updated information. That is not what user expects -
they want to use "Back" button on the browser and still get page with
updated results. Till now I thought that it is impossible unless user plays
around with browser history setting.
But now I see sites that do update the content of the page even if I click
"Back" button.

My question if it possible in ASP.NET and how?
Thanks,
Shimon

"Mark Sandfox" <No****@NoSpam. com> wrote in message
news:Pq******** *********@newss vr31.news.prodi gy.com...
Your page_load is rewriting the page each time you enter because you do
not have your code trap within the following:

If NOT IsPostBack then

End If

"Shimon Sim" <es*****@att.ne t> wrote in message
news:OR******** ******@TK2MSFTN GP10.phx.gbl...
Hi,
Every time I write ASP.NET application I have the same problem - Back
button on the browser is my enemy. I have to tell client avoid using
"Back" button and if you use it make sure to refresh the page to latest
information.

I decided to pay information to application on the web and I see that
some sites don't have those issues. Like I used some forum site that uses
PERL (files with ext. pl) and Back button from browser gets new updated
page everytime.
Can I do anything about this in ASP.NET?
Thanks,
Shimon.


Nov 19 '05 #3
I'm not sure how those other sites do it, but in .net you can use the
IsPostBack property to make your life a lot easier. In my current project
with JSP, we had to create an entire transaction framework to protect
us/data from the Back button too. After four months or so, I figured there
HAD to be a better way. There was, it's called .net! :> haha

Maybe the IsPostBack isn't going to solve your problem 100%, but I hope it's
a good start.
"Shimon Sim" <es*****@att.ne t> wrote in message
news:OR******** ******@TK2MSFTN GP10.phx.gbl...
Hi,
Every time I write ASP.NET application I have the same problem - Back
button on the browser is my enemy. I have to tell client avoid using
"Back" button and if you use it make sure to refresh the page to latest
information.

I decided to pay information to application on the web and I see that some
sites don't have those issues. Like I used some forum site that uses PERL
(files with ext. pl) and Back button from browser gets new updated page
everytime.
Can I do anything about this in ASP.NET?
Thanks,
Shimon.

Nov 19 '05 #4
I got second answer with IsPostBack... I know about it. It just solves the
issue that if you press a button on the form you don't want to do the same
actions that you do initial "arrival" to the page. It allows you to save
some calls to database and improve performance. In some cases you must use
it if you want to get new information from user.

Now ...
The problem is that if user clicks on the "Back" <-- button on the browser
then usually you get cash of the page that was saved by browser. (Am I wrong
about it? At least this is what I and my clients see). Really what I want to
get is updated version of the page.
Let say you have Product Information page that shows you basic information
about product. You have update functionality on a different page "Update
product information". Let say for sake of discussion after you update
product information you stay on the same page and don't redirect to Product
Information page. Now user wants to see product information page he /she
clicks on the "Back button on the browser (may be two times in my scenario)
and sees the page with old information (then client calls me and tells me
about a bug and I have to tell him/her to refresh the page. After few calls
the get the idea and I am off the hook.)

Can I do anything so the page will update after a user clicks on "Back"
button?
Again Thank you.
Shimon.
"Shimon Sim" <es*****@att.ne t> wrote in message
news:OR******** ******@TK2MSFTN GP10.phx.gbl...
Hi,
Every time I write ASP.NET application I have the same problem - Back
button on the browser is my enemy. I have to tell client avoid using
"Back" button and if you use it make sure to refresh the page to latest
information.

I decided to pay information to application on the web and I see that some
sites don't have those issues. Like I used some forum site that uses PERL
(files with ext. pl) and Back button from browser gets new updated page
everytime.
Can I do anything about this in ASP.NET?
Thanks,
Shimon.

Nov 19 '05 #5
Maybe you want to look at the response object and tell it not to cache the
page. Or, I think the Cach API also has a method that you can sent along with
the response object to not to cache the page. Also, if you want your page to
load new data each time the page is loaded, then you should not enclose your
code in the If Not IsPostBack.

"Shimon Sim" wrote:
Sorry.
But you totally misunderstood the problem. I always check IsPostBack. It is
not the point.
The problem is what happens when user clicks on the "Back" button on the
browser. What I usually get is the old cashed on the client page that needs
to be refreshed to get updated information. That is not what user expects -
they want to use "Back" button on the browser and still get page with
updated results. Till now I thought that it is impossible unless user plays
around with browser history setting.
But now I see sites that do update the content of the page even if I click
"Back" button.

My question if it possible in ASP.NET and how?
Thanks,
Shimon

"Mark Sandfox" <No****@NoSpam. com> wrote in message
news:Pq******** *********@newss vr31.news.prodi gy.com...
Your page_load is rewriting the page each time you enter because you do
not have your code trap within the following:

If NOT IsPostBack then

End If

"Shimon Sim" <es*****@att.ne t> wrote in message
news:OR******** ******@TK2MSFTN GP10.phx.gbl...
Hi,
Every time I write ASP.NET application I have the same problem - Back
button on the browser is my enemy. I have to tell client avoid using
"Back" button and if you use it make sure to refresh the page to latest
information.

I decided to pay information to application on the web and I see that
some sites don't have those issues. Like I used some forum site that uses
PERL (files with ext. pl) and Back button from browser gets new updated
page everytime.
Can I do anything about this in ASP.NET?
Thanks,
Shimon.



Nov 19 '05 #6
> But you totally misunderstood the problem. I always check IsPostBack. It
is Yup, I misunderstood as well, sorry 'bout that.
browser. What I usually get is the old cashed on the client page that
needs

Can you play with the expiry date for the page? Someone else with more html
and aspx knowledge should be able to chime in here so I can learn about this
too. But it sounds like you don't necessarily want to chop their fingers
off for using the Back button, just protect yourself from displaying
cached/old data? Setting the page expiry to something like zero should
force IE to refresh the page when the user hits the back button. Or maybe
I'm totally wrong? Sorry if I am.
Nov 19 '05 #7
you can code the same in asp.net.

1) set the page to expire, so when back button is hit, it refreshed rather
than pulled from cache
2) break yourself from the asp.net postback model. once you do above, your
users will see the browser alert that data needs to be resent on a back to a
postback page. instead use real anchors (not link buttons) for navigation.
3) on pages that post, design so they can repost. for example with a cart,
ask for new the quanity instead of click to add one.

a little design work and the back button is your friend. its such a popular
feature, that windows apps are adding back button support.

-- bruce (sqlwork.com)

"Shimon Sim" <es*****@att.ne t> wrote in message
news:OR******** ******@TK2MSFTN GP10.phx.gbl...
| Hi,
| Every time I write ASP.NET application I have the same problem - Back
button
| on the browser is my enemy. I have to tell client avoid using "Back"
button
| and if you use it make sure to refresh the page to latest information.
|
| I decided to pay information to application on the web and I see that some
| sites don't have those issues. Like I used some forum site that uses PERL
| (files with ext. pl) and Back button from browser gets new updated page
| everytime.
| Can I do anything about this in ASP.NET?
| Thanks,
| Shimon.
|
|
Nov 19 '05 #8
bruce barker wrote:
you can code the same in asp.net.

1) set the page to expire, so when back button is hit, it refreshed
rather than pulled from cache


That's a dangerous fallacy. The HTTP 1.1 spec specifies that history
mechanisms are not caches and thus don't need to honor Cache-Control or
Expires headers. Not even Cache-Control: no-store.

Atually, many browsers *don't* work like that, provided the protocol is
HTTP 1.1. Thus, the "avoid caching" trick works more often than not,
Opera being one noticeable exception (maybe it's just that I've never
found the magic combination of Cache-Control/Expires headers that makes
it do that).

But once you're down to HTTP 1.0 it gets really nasty...

Cheers,

--
http://www.joergjooss.de
mailto:ne****** **@joergjooss.d e
Nov 19 '05 #9

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

Similar topics

21
3185
by: Tony Marston | last post by:
If the use of the browser's BACK button is interfering with the operation of your web application then take a look at this article entitle "Back Button Blues" http://www.tonymarston.co.uk/php-mysql/backbuttonblues.html -- Tony Marston http://www.tonymarston.net
0
1221
by: jaydfischer | last post by:
Here is the code that I tried with no luck. Even though the cache is not saved, the page still appears but goes to the server to get the page instead of local cache. When it comes back to the page load event the ViewState no longer exist but the session does. Any help would be greatly appreciated! Private Sub Page_Load(ByVal sender As...
29
3965
by: Tom wilson | last post by:
I can't believe this is such an impossibility... I have an asp.net page. It accepts data through on form fields and includes a submit button. The page loads up and you fill out some stuff. The submit button posts the page back to the server. The button code detects an entry error and sends the page back to the user. This all works. ...
11
1441
by: Sandy | last post by:
Hello - Thought I was almost done with my project and then a back arrow button issue raised its ugly head. Once a user fills out a form and submits it (done via stored procedure into a Sql Server database), what's to prevent them from pressing the back button and resubmitting the form multiple times and creating havoc with my database?...
5
2991
by: ns21 | last post by:
How can the browser back button be disabled If the form is submitting information to other pages or submitting to itself or using redirections. I tried the tweaks like history.forward(1) in each page to prevent user to navigate back but its not very effective. The server side scripting is done using ASP. you may ask that why at first...
1
3040
by: mrboyer79 | last post by:
hello all, i'm having an issue where the back button i created (not the browser back) is causing me to lose data. allow me to explain: i have three pages. page one is a short form where the user enters in their name (first, mi, last) and a number and there's a y/n radio button. the user then clicks submit and is taken to page two. page two is...
7
2482
by: nkodali | last post by:
Hi, I am having a signup.asp page where a user enters his details and clicks on subscribe button. I am doing server side validation to check if the user already exists in the database and then allowing him to subscribe using VB script. This subscription will send an email and then redirect to a thank you page once the user is validated. Now my...
1
3959
by: CoolRajan | last post by:
Hi friends, I have four form pages in my application and all the pages contain different fields for entering values in that. In my first page I have one Continue button and on submitting it redirects to second page. In the second page I have two buttons namely Back and Continue. After entering values in the second form page if I click the Back...
1
1959
by: Lavankumar | last post by:
Hi, My application runs fine in IE6 and firefox but when I tested in IE7 my back button on the browser leaves me at "Webpage expired" and I am using POST as I should not use GET but when I tried using GET it works fine, It would be great if I get any help that I need to do in JSP using POST only would be great. I have been searching for the...
0
7665
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7888
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.