Solved

Response to show PDF file cache problem

Posted on 2011-09-15
2
286 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

861 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