Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
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
Reply With Quote
  #2 (permalink)  
Old April 14th, 2010, 05:01 PM
Imar's Avatar
Wrox Author
Points: 67,286, Level: 100
Points: 67,286, Level: 100 Points: 67,286, Level: 100 Points: 67,286, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,228
Thanks: 66
Thanked 1,416 Times in 1,396 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!
Reply With Quote
  #3 (permalink)  
Old July 27th, 2010, 01:33 AM
Banned
 
Join Date: Jun 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
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>
Reply With Quote
Reply


Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 04:00 PM
Caching Amateur BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 February 9th, 2007 01:50 PM
caching? freaknfreak HTML Code Clinic 1 January 24th, 2006 11:10 AM
Caching bmains ASP.NET 1.x and 2.0 Application Design 4 February 27th, 2004 08:06 AM



All times are GMT -4. The time now is 06:09 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.