| Join | Help
in

Strong Coders Community

Where the extreme coders hang out.

How to delete Temp Internet Files through code in ASP.NET

Last post 01-01-2007 2:46 PM by agrath . 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 11-01-2006 12:04 AM
    • manishbafna
    • Top 10 Contributor
      Male
    • Joined on 10-18-2006
    • India
    • Posts 60
    • Points 1,000

    How to delete Temp Internet Files through code in ASP.NET

    Reply Contact

    Hi,

    I am implementing stock chart in asp.net though AJAX.It gets refreashed every few seconds.The probelm is that chart

    is not updated one(that is it is not live).Because it is picking images from temporary internet files.I have tried following but

    it is not working.

    Response.ExpiresAbsolute=DateTime.Now.AddDays(-1d);
    Response.Expires =-1500;
    Response.CacheControl = "no-cache";

    can anybody help me out as to how to delete temporary internet files in asp.net through code.

    Regards,

    Manish Bafna.

     

    • Post Points: 35
  • 11-01-2006 1:28 AM In reply to
    • Kevin Jones
    • Top 10 Contributor
      Male
    • Joined on 07-27-2006
    • Falls Church, VA
    • Posts 94
    • Points 3,360
    • MicrosoftMVP
      Moderator
      StrongCoders

    Re: How to delete Temp Internet Files through code in ASP.NET

    Answer
    Reply Contact

    Are you sure it is Temporary Internet Files causing the problem? To test it, turn it off in your broswer to see if that fixes it. Then we will be sure that is the problem.

    Your code for disabling cache is correct though.

    Cheers,
         Kevin
    • Post Points: 5
  • 11-08-2006 11:35 AM In reply to
    • JamesCurran
    • Top 10 Contributor
      Male
    • Joined on 11-01-2006
    • Bloomfield, NJ, USA
    • Posts 95
    • Points 1,255
    • StrongCoders

    Re: How to delete Temp Internet Files through code in ASP.NET

    Answer
    Reply Contact

    manishbafna:
    can anybody help me out as to how to delete temporary internet files in asp.net through code.

    Actually, you don't want to do it throught ASP.Net.  Since it must be done of the users machine, you would have to do it in JavaScript. This leads to new & different problems, as each brower probably has a different way to handle clearing it own cache.

    Plus you have a bigger problem.  It's the user's cache.  You don't have the right to decide for them when it's cleared.

    Your root problem is almost certainly something else.  Investigate further.

    Truth,
    James
    • Post Points: 20
  • 11-08-2006 12:46 PM In reply to
    • Kevin Jones
    • Top 10 Contributor
      Male
    • Joined on 07-27-2006
    • Falls Church, VA
    • Posts 94
    • Points 3,360
    • MicrosoftMVP
      Moderator
      StrongCoders

    Re: How to delete Temp Internet Files through code in ASP.NET

    Answer
    Reply Contact
    That isn't completely true. The client's cache for a specific page can be controlled with meta tags and specific HTTP Headers in the repsonse.
    Cheers,
         Kevin
    • Post Points: 20
  • 01-01-2007 2:46 PM In reply to
    • agrath
    • Top 75 Contributor
    • Joined on 12-27-2006
    • Posts 1
    • Points 5

    Re: How to delete Temp Internet Files through code in ASP.NET

    Reply Contact

    When you make your ajax call to get the stock data, try appending a random number to the query.

    For example,

    dim url as string = string.format( http://stockprices.net/currentstockprices.aspx?r={0} , rnd()*10000)

     

    • Post Points: 5
Page 1 of 1 (5 items)

Copyright © 2006-2007 Strong Coders Community. All rights reserved.
Privacy Statement | Terms Of Use | Advertise with us | Site Feedback

Powered by Community Server (Commercial Edition), by Telligent Systems