473,804 Members | 2,101 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How prevent cachine in ASPX page (I think)?

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
Oct 23 '06 #1
1 1644
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.asp x?id=3";
resourceUri+="& rand="+System.D ateTime.Now.Tic ks.ToString();

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
Oct 23 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2814
by: Jerry Tovar | last post by:
I am using .Net 2003 on a XPPro running IIS. I am unable to view any of my ASPX webforms in a browser unless I modify the .ASPX file and replace Codebehind="employee.aspx.cs" with src="employee.aspx.cs". It looks like my bin/employee.dll file is not being used. Instead, my employee.aspx.cs file is being used.
3
3273
by: feng | last post by:
In my ASP.Net app I have a aspx page that's called by an other page's client side JavaScript code. The problem is that the first time this page get loaded, it will be cached in the user's local cache and will not be refreshed in the following calls. I checked the following calls and I see that even the page's Page_Load method of the codebehind will not be invoked. I also checked that if I clear the browser's cache each time the page...
9
2296
by: Daniel Walzenbach | last post by:
Hi I am faced with the following problem: I have a page (let’s call this page page1.aspx) containing some TextBoxes and a hyperlink which opens another page (let’s call this page page2.aspx) as a popup using either window.open or window.showModalDialog. Since I want to warn the users of my application when they try to close page1.aspx and have changed the values in the meantime I thought about using the “onbeforeunload” event of the...
5
10078
by: Earl Teigrob | last post by:
I am creating an application where I would like to give web designers the ablity to create a static html page and dyanamically load it into my application(exactly like loading a user control into a page). Is there an easy way to do this or do I need to stream the html into my application and parse unwanted header/footer info before rendering it within the application page (as a literal control, i imagine) Has anyone done this or seen any...
1
1515
by: Les Caudle | last post by:
One aspx page on my site started displaying garbage. No errors, just a bunch of symbol characters. The page used C# code behind and Output Cachine: <%@ OutputCache Duration="86400" VaryByParam="ProductID" %> I did not recompile the app - but only changed the modification date of the aspx file so that it would be recompiled - which fixed it. However, I'd sure like to know how to prevent it - as it displayed the same
2
1636
by: kermit | last post by:
I have a .net aspx page MyPage.aspx (client side) with code behind MyPage.aspx.vb (server side). I use the Page_Load event in MyPage.aspx.vb to load data into a multiteir class based collection. MyCollection(sYear).cMonths(sMonth).cDays(sDay).cEvents(sID).EventText My problem arrives when I try to access this collection from the page (MyPage.aspx).
1
2292
by: Gaetan | last post by:
I'm doing a prrof of concept to develop an application to run under WinPE. The application will use WinHTTP to send requests to an ASPX file running IIS 6.0 My problem is that I do not know how to prevent IIS from returning the HTTP code of the ASPX page. The client side use something like this to initiate the request: set obj1 = createobject("WinHttp.WinHttpRequest.5.1") obj1.SetProxy HTTPREQUEST_PROXYSETTING_DIRECT obj1.Open "GET",...
4
1734
by: moondaddy | last post by:
I have a .net 1.1 winforms app that calls an aspx page which I need to debug. I also need to start the debugging process from the winform because the winform first calls a web service which passed secure data to the web server and is cached for 10 seconds and returns a guid. when the winform loads, it passes in this guid as a param to find the data being cached. It then uses this data for various processing. Therefore, I can't simply...
4
18138
by: =?Utf-8?B?QXNhZg==?= | last post by:
Hi, How can I prevent from an ASP.NET page to resend all the data again when the user press the Refresh button or F5 on the browser? Thanks in advanced, Asaf
0
9594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10350
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10351
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10096
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7638
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6866
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3834
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.