473,748 Members | 3,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why all the pages when I press back button ?

Hi there,
I am *very* new to this... so please excuse poor terminology etc.

I am building a small content management system.. and have just managed to
get an asp.net page up & running that edits / deleted data presented via a
datagrid via a datareader. All is well, the database is updated correctly..

However after merrily doing a few update cylces, I noticed afterwards that
when I pressed the back button on the browser, I was presented with a
"historical " page for each post cycle. Is there a way to stop this ? I don't
want to see any "history" in this way ...

Is this normal, or is there a setting to prevent this happening ?

Thanks,

Bazza

Nov 19 '05 #1
5 1190
There are several ways a page can be cached, and so there are several ways
you can specify for a page to not be cached.
This code has worked well for me:

Response.Expire s = 0
Response.Cache. SetNoStore()
Response.Append Header("Pragma" , "no-cache")

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Bazza Formez" <ba**********@p aradise.net.nz> wrote in message
news:aF******** ************@ne ws02.tsnz.net.. .
Hi there,
I am *very* new to this... so please excuse poor terminology etc.

I am building a small content management system.. and have just managed to
get an asp.net page up & running that edits / deleted data presented via a
datagrid via a datareader. All is well, the database is updated
correctly..

However after merrily doing a few update cylces, I noticed afterwards that
when I pressed the back button on the browser, I was presented with a
"historical " page for each post cycle. Is there a way to stop this ? I
don't want to see any "history" in this way ...

Is this normal, or is there a setting to prevent this happening ?

Thanks,

Bazza

Nov 19 '05 #2
This is unfortunately one of the side-effects of using server-side
processing in a stateless environment. Nearly every action requires a
round-trip to the server. There's nothing you can really do about it short
of moving all of your logic to the client side and doing a batch update.

Here's the (short and extremely simplified) explanation of why this happens:
1.) User accesses page (page request, 1st history item added)
2.) User clicks "edit" for one of the items in the grid. The form submits
(another page request) so the page can be rerendered using text boxes,
etc... (2nd history item added)
3.) User makes changes and clicks "save." The form submits (another page
request) so the database can be updated and the grid redrawn with the
changes. (3rd history item added)
4.) User clicks "delete." The form is submitted (yet another page request)
so the item can be deleted from the database and the grid can be redrawn
with the changes
5.) ... you probably get the picture by now.

As you can see, each of these actions result in a page request, which causes
the browser to add an item to the history list.

--
Dave Fancher
http://davefancher.blogspot.com
"Bazza Formez" <ba**********@p aradise.net.nz> wrote in message
news:aF******** ************@ne ws02.tsnz.net.. .
Hi there,
I am *very* new to this... so please excuse poor terminology etc.

I am building a small content management system.. and have just managed to
get an asp.net page up & running that edits / deleted data presented via a
datagrid via a datareader. All is well, the database is updated
correctly..

However after merrily doing a few update cylces, I noticed afterwards that
when I pressed the back button on the browser, I was presented with a
"historical " page for each post cycle. Is there a way to stop this ? I
don't want to see any "history" in this way ...

Is this normal, or is there a setting to prevent this happening ?

Thanks,

Bazza

Nov 19 '05 #3
....short of caching that is! Thanks Steve

I guess it's too late and I should be going to bed...

--
Dave Fancher
http://davefancher.blogspot.com
"Dave Fancher" <ei*****@comcas t.net> wrote in message
news:5M******** ************@co mcast.com...
This is unfortunately one of the side-effects of using server-side
processing in a stateless environment. Nearly every action requires a
round-trip to the server. There's nothing you can really do about it
short of moving all of your logic to the client side and doing a batch
update.

Here's the (short and extremely simplified) explanation of why this
happens:
1.) User accesses page (page request, 1st history item added)
2.) User clicks "edit" for one of the items in the grid. The form submits
(another page request) so the page can be rerendered using text boxes,
etc... (2nd history item added)
3.) User makes changes and clicks "save." The form submits (another page
request) so the database can be updated and the grid redrawn with the
changes. (3rd history item added)
4.) User clicks "delete." The form is submitted (yet another page
request) so the item can be deleted from the database and the grid can be
redrawn with the changes
5.) ... you probably get the picture by now.

As you can see, each of these actions result in a page request, which
causes the browser to add an item to the history list.

--
Dave Fancher
http://davefancher.blogspot.com
"Bazza Formez" <ba**********@p aradise.net.nz> wrote in message
news:aF******** ************@ne ws02.tsnz.net.. .
Hi there,
I am *very* new to this... so please excuse poor terminology etc.

I am building a small content management system.. and have just managed
to get an asp.net page up & running that edits / deleted data presented
via a datagrid via a datareader. All is well, the database is updated
correctly..

However after merrily doing a few update cylces, I noticed afterwards
that when I pressed the back button on the browser, I was presented with
a "historical " page for each post cycle. Is there a way to stop this ? I
don't want to see any "history" in this way ...

Is this normal, or is there a setting to prevent this happening ?

Thanks,

Bazza


Nov 19 '05 #4
Thanks for that Dave.

"Dave Fancher" <ei*****@comcas t.net> wrote in message
news:1u******** ************@co mcast.com...
...short of caching that is! Thanks Steve

I guess it's too late and I should be going to bed...

--
Dave Fancher
http://davefancher.blogspot.com
"Dave Fancher" <ei*****@comcas t.net> wrote in message
news:5M******** ************@co mcast.com...
This is unfortunately one of the side-effects of using server-side
processing in a stateless environment. Nearly every action requires a
round-trip to the server. There's nothing you can really do about it
short of moving all of your logic to the client side and doing a batch
update.

Here's the (short and extremely simplified) explanation of why this
happens:
1.) User accesses page (page request, 1st history item added)
2.) User clicks "edit" for one of the items in the grid. The form
submits (another page request) so the page can be rerendered using text
boxes, etc... (2nd history item added)
3.) User makes changes and clicks "save." The form submits (another page
request) so the database can be updated and the grid redrawn with the
changes. (3rd history item added)
4.) User clicks "delete." The form is submitted (yet another page
request) so the item can be deleted from the database and the grid can be
redrawn with the changes
5.) ... you probably get the picture by now.

As you can see, each of these actions result in a page request, which
causes the browser to add an item to the history list.

--
Dave Fancher
http://davefancher.blogspot.com
"Bazza Formez" <ba**********@p aradise.net.nz> wrote in message
news:aF******** ************@ne ws02.tsnz.net.. .
Hi there,
I am *very* new to this... so please excuse poor terminology etc.

I am building a small content management system.. and have just managed
to get an asp.net page up & running that edits / deleted data presented
via a datagrid via a datareader. All is well, the database is updated
correctly..

However after merrily doing a few update cylces, I noticed afterwards
that when I pressed the back button on the browser, I was presented with
a "historical " page for each post cycle. Is there a way to stop this ? I
don't want to see any "history" in this way ...

Is this normal, or is there a setting to prevent this happening ?

Thanks,

Bazza



Nov 19 '05 #5
Thanks Steve.. I will try those settings.
"Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
There are several ways a page can be cached, and so there are several ways
you can specify for a page to not be cached.
This code has worked well for me:

Response.Expire s = 0
Response.Cache. SetNoStore()
Response.Append Header("Pragma" , "no-cache")

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Bazza Formez" <ba**********@p aradise.net.nz> wrote in message
news:aF******** ************@ne ws02.tsnz.net.. .
Hi there,
I am *very* new to this... so please excuse poor terminology etc.

I am building a small content management system.. and have just managed
to get an asp.net page up & running that edits / deleted data presented
via a datagrid via a datareader. All is well, the database is updated
correctly..

However after merrily doing a few update cylces, I noticed afterwards
that when I pressed the back button on the browser, I was presented with
a "historical " page for each post cycle. Is there a way to stop this ? I
don't want to see any "history" in this way ...

Is this normal, or is there a setting to prevent this happening ?

Thanks,

Bazza


Nov 19 '05 #6

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

Similar topics

0
747
by: sophocles the wise | last post by:
automatically post data & click buttons on sequence of web pages with AxWebBrowser Hi, I need to post stuff everyday to a website and am working on a VB program to do this for me. I am a computer technician and I post an ad on craigslist.org everyday but sometimes I don't have time to do this. So, I accomplished so far to load the first page and post my ad in the textbox, with title and email address, and to alter the radio button and...
2
2401
by: Johann Blake | last post by:
The following is a bug I have discovered using tab pages and threads and I am looking for a workaround. Create a new Windows Forms application and add a tab control with two tab pages. Add a label to each tab page. On the first tab page add a button. When the button is pressed the code behind the button creates a thread and starts that thread. The only thing that the thread is to do is to switch from the first tab page to the 2nd tab...
2
869
by: Simon | last post by:
Hi everyone, I'm using a repeater on a page of mine to display a list of hospitals pending authorisation to take part in a trial. When the user clicks a button it takes him/her to another page that allows them to authorise the hospital. Now, when the user goes back to the previous page (by following a link), the repeater still shows the (now authorised) site when it shouldnt. The problem fixes itself when I press refresh, which isn't...
9
4921
by: tshad | last post by:
This is from my previous post, but a different issue. I have the following Javascript routine that opens a popup page, but doesn't seem to work if called from an asp.net button. It seems to work fine from a link. The button does bring up the popup window, but when I press the links on the page, it doesn't return or close the window. ****************************************************************************
1
1382
by: tshad | last post by:
This is driving us crazy. And it only seems to happen in IE. Mozilla and Firefox don't have this problem. We get this message all the time, but I can't figure out why as it is not consistant (or doesn't seem to be). ********************************************************************************************************************** Warning: Page has Expired The page you requested was created using information you submitted in a form....
0
1970
by: neeraj | last post by:
Hi Everybody I have one problem in my asp.net web application. The problem is that I check the date validation in code behind; if user not gives the valid data and press save button then I fire my own exception by JavaScript alert message Through register startup script Like RegisterStartupScript("Startup", "<script language=javascript>
4
7627
by: nkoier | last post by:
Hi, I've been going crazy trying to figure out what's wrong with our Asp.Net 2.0 intranet site. At the very top of our main page I provide a TextBox and a Button for submitting Google searches. Recently somebody pointed out to me that you can't just press ENTER anymore after typing in the TextBox but that you HAVE to click on the submit Button WITH THE MOUSE for it to work. After some initial troubleshooting I discovered that it's only...
1
1580
by: =?Utf-8?B?UmljaGFyZA==?= | last post by:
Hi, After the user is signed out and taken to the login page, they can still use the back & history features in the browser to access pages. Every page (except login) has a check at the beginning to redirect the user after being logged out, but when the page is accessed via back button, the debugger doesn't stop at that code b/c the page is cached and is not generated at the server. How can I make these pages disappear from the...
0
8989
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9537
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9367
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9243
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6073
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4599
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2213
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.