Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Why all the pages when I press back button ?

Reply
Thread Tools

Why all the pages when I press back button ?

 
 
Bazza Formez
Guest
Posts: n/a
 
      12-05-2004
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



 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      12-05-2004
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" <> wrote in message
news:aFysd.13725$...
> 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
>
>
>



 
Reply With Quote
 
 
 
 
Dave Fancher
Guest
Posts: n/a
 
      12-05-2004
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" <> wrote in message
news:aFysd.13725$...
> 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
>
>
>



 
Reply With Quote
 
Dave Fancher
Guest
Posts: n/a
 
      12-05-2004
....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" <> wrote in message
news:5MCdnUzINqcVXS_cRVn-...
> 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" <> wrote in message
> news:aFysd.13725$...
>> 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
>>
>>
>>

>
>



 
Reply With Quote
 
Bazza Formez
Guest
Posts: n/a
 
      12-05-2004
Thanks for that Dave.



"Dave Fancher" <> wrote in message
news:1uadncUkMeyTXC_cRVn-...
> ...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" <> wrote in message
> news:5MCdnUzINqcVXS_cRVn-...
>> 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" <> wrote in message
>> news:aFysd.13725$...
>>> 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
>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Bazza Formez
Guest
Posts: n/a
 
      12-05-2004
Thanks Steve.. I will try those settings.


"Steve C. Orr [MVP, MCSD]" <> wrote in message
news:%23Uoya$...
> 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" <> wrote in message
> news:aFysd.13725$...
>> 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
>>
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox back button takes me back 2 pages. Useful Info Javascript 0 06-02-2007 11:21 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
when i Press Back Button on the Menu there is an Issue Preethi ASP .Net 1 12-22-2005 08:08 PM
disable the back button provide the users with my own button to go back. sylvia sil ASP .Net 1 12-29-2004 04:41 PM
How to make the page expire when user press the back button? Loke Kit Kai ASP .Net 2 12-01-2003 04:15 AM



Advertisments