473,397 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

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 1176
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.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Bazza Formez" <ba**********@paradise.net.nz> wrote in message
news:aF********************@news02.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**********@paradise.net.nz> wrote in message
news:aF********************@news02.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*****@comcast.net> wrote in message
news:5M********************@comcast.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**********@paradise.net.nz> wrote in message
news:aF********************@news02.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*****@comcast.net> wrote in message
news:1u********************@comcast.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*****@comcast.net> wrote in message
news:5M********************@comcast.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**********@paradise.net.nz> wrote in message
news:aF********************@news02.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.net> wrote in message
news:%2****************@tk2msftngp13.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.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Bazza Formez" <ba**********@paradise.net.nz> wrote in message
news:aF********************@news02.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
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...
2
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...
2
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...
9
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...
1
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...
0
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...
4
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....
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...
0
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...
0
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,...
0
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...

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.