Wrox Programmer Forums
|
BOOK: Professional ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Professional ASP.NET 4 in C# and VB by Bill Evjen, Scott Hanselman, Devin Rader; ISBN: 9780470502204
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 4 : in C# and VB 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 April 14th, 2010, 04:55 PM
Registered User
 
Join Date: Apr 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default caching

hi i have a problem incaching
 
Old April 14th, 2010, 05:01 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Bummer....
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old July 27th, 2010, 01:33 AM
abivojon
Guest
 
Posts: n/a
Default

As you have not posted the code it is sifficult to say whether there is an error in the code itself, but one thing to check is that there is NO white space above the redirect command.

For example if you had code that looked like this:

<%
response.addHeader
("Pragma","No-cache");
response.addHeader
("Cache-Control","no-cache");
response.addDateHeader
("Expires",1);
%>
<% HttpSession s =
request.getSession();
if (request.
isRequestedSessionIdValid()
== false || s.getAttribute("userInfo") == null)
{
response.sendRedirect("Login.jsp");
}
%>

you would get a cahcing error because there is white space between the %> and <% which opens the redirect section. To fix this you'd change the code to read:

<%
response.addHeader
("Pragma","No-cache");
response.addHeader
("Cache-Control","no-cache");
response.addDateHeader
("Expires",1);
%><% HttpSession s =
request.getSession();
if (request.
isRequestedSessionIdValid()
== false || s.getAttribute("userInfo") == null)
{
response.sendRedirect
("Login.jsp");
}
%>

Chardham tour operators
Seo Training Course Delhi
Another possible solution is to replace the sendRedirect() with an actual anchored link such as:
<A HREF = "Url for page">Go here</A>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Caching stu9820 ASP.NET 3.5 Basics 0 June 20th, 2008 03:20 PM
caching jezywrap ASP.NET 2.0 Professional 0 February 27th, 2007 05:00 PM
Caching Amateur BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 February 9th, 2007 02:50 PM
caching? freaknfreak HTML Code Clinic 1 January 24th, 2006 12:10 PM
Caching bmains ASP.NET 1.x and 2.0 Application Design 4 February 27th, 2004 09:06 AM





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