Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 21st, 2006, 05:10 PM
rjd rjd is offline
Authorized User
 
Join Date: Nov 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm discovering that I need browser caching on page that I return to when the page that I am currently on contains a Back button with the definition: onclick="history.go(-1);". These pages are the pages containing DataGrids. These pages are cached sometimes with the wrong theme.

I know I can not redefine the Back button because I don't know the search criteria used to define the previous page.
 
Old November 21st, 2006, 05:17 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yes, that's (usually) correct. Many .NET controls perform a postback. When you'd reload a posted page, you get the browser's warning about resubmitting that page. This is to prevent you from submitting the same info twice. Since the browser can't distinguish between an order being paid twice, and a harmless move to another page on a GridView, this is a good thing.

As an alternative to the back button with history.go(-1), you could provide Back links / buttons that perform a redirect to the previous page. That way, the page is loaded again, without a browser's warning.

Does that help?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old November 28th, 2006, 04:28 PM
rjd rjd is offline
Authorized User
 
Join Date: Nov 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I was thinking of another approach to solve this problem. If I used the OutputCache directive with the "VaryByParam" attribute and add "theme=<color>" to all querystrings.

Can I append "&theme=<preferred theme>" or "?theme=<preferred theme>" string onto the querystring in an overrides Sub OnPreInit() call? I cannot find any documentation on when the OutputCache directive is processed and if it is processed after the OnPreInit method call.
 
Old November 28th, 2006, 06:31 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

This feels a bit weird and sounds like a lot of work.

Besides, it probably won't help. Since the page is cached by the browser, it never hits the server, so IIS / ASP.NET is never able to return a cached copy.

If I were you, I'd look into cache settings for your browser and your web server (IIS).

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
DropDown Dynamic Value Change Master/Detail moizshabbir PHP How-To 1 May 9th, 2008 06:24 AM
Chapter 5 Applying themes to Page Try it Out mcauliff BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 October 3rd, 2007 11:04 AM
Add dynamic css to master/content page proj-How? VictorVictor ASP.NET 2.0 Basics 6 June 9th, 2006 12:09 PM
Bugbase - superuser not there, tried adding Far BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 April 25th, 2006 01:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.