I created an aspx page and viewed it in Firefox and Chrome and it worked correctly, running the C# code. But when I make changes to the page (including deleting everything and serving up a blank page), both browsers continue to show the original compiled aspx page!
It appears that ASP.Net (the web server) is not recompiling despite changes to the aspx file. The only way to get it to recompile is to change web.config and then restart the web server!
I even added the following code, but it still loads the original page:
<script runat="server">
Sub Page_Load
Random rd = new Random();
Response.AddHeader("ETag", rd.Next(1111111, 9999999).ToString());
Response.AddHeader("Pragma", "no-cache");
Response.CacheControl = "no-cache";
Response.Cache.SetNoStore();
Response.Expires = -1;
End Sub
</script>
TEST I DID TO RULE OUT BROWSER CACHING:
- Created an aspx page and loaded it in firefox only (not in chrome)
- Changed the aspx file
- Loaded aspx again in firefox but got no changes
- Loaded it (for the first time ever) in Chrome and it still showed the old version!
Using Apache and Mono, not IIS
This appears to be a Mono+Apache on Linux issue. It doesn’t see changes to pages that have been compiled. The only workarounds are:
Restart Apache webserver (this causes it to see them as changed) – only takes about 2 seconds
Delete the temporary files in “/tmp/www-data-temp-aspnet-0/” (This can be a bit buggy so #1’s a better choice)