473,699 Members | 2,801 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 1185
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
2397
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
867
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
4917
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
1381
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
1969
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
7622
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
1579
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
8615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8882
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
7748
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6533
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5872
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
4375
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...
0
4627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2345
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.