Solved

Response to show PDF file cache problem

Posted on 2011-09-15
2
285 Views
Last Modified: 2012-05-12
Hi,

I have the follow VB.NET code in a ASP.NET page to show PDF files.

            With Response
                .RedirectLocation = "PDF"
                .Clear()
                .ClearHeaders()
                .ContentType = "application/pdf"
                .WriteFile({COMPLETE FILE NAME PATH})
                .Flush()
                .Close()
            End With

Open in new window


It work fine in the first time that I select a PDF file. But when I select a PDF file that has already been shown before, do not load it again, remains to be shown the last PDF file loaded.

How can I fix this bug?

Thanks in advance, Camarate
0
Comment
Question by:Marcelo Camarate
2 Comments
 
LVL 15

Accepted Solution

by:
pateljitu earned 250 total points
ID: 36546099
Can you try these please:

.AddHeader("Pragma", "no-cache");
.CacheControl = "no-cache";
.Cache.SetCacheability(HttpCacheability.NoCache)
0
 

Author Closing Comment

by:Marcelo Camarate
ID: 36548624
Hi pateljitu,

The application is working fine now.

Regards, Camarate
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question