Ronald,
This is really an ASP.NET question, not a C# language newsgroup one.
There are lots of ways to prevent caching, some more complex than others,
but if you want to "keep it simple", the key is to understand that if the url
is unique each time, the browser will not find it in its cache and will make
a new request for the resource. A very simple example (I did say, "Keep it
simple", right?):
string resourceUri = "http://localhost/fwi/mediaplayer.aspx?id=3";
resourceUri+="&rand="+System.DateTime.Now.Ticks.To String();
Your URL still has the id=3, but it now also has an additional querystring
parameter
that is not used, but which effectively makes the url unique each time.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Ronald S. Cook" wrote:
I have an ASPX page wherein I receive an ID of a file to play.
http://localhost/fwi/mediaplayer.aspx?id=3
When I go to a browser and type in the above, it works fine.
But when I change the 3 to a 4, it still plays the old song.
I tried some lines of code to prevent caching, but so far nothing works.
The only thing that does work, is to click Tool.. Options (in Internet
Explorer) and click to delete temporary internet files. Then song ID=4
plays.
Am I just not yet onto the proper prevent caching code?
Thanks,
Ron