I have an aspx page (page.aspx) and in the page load event I have a code to generate a .txt
file. Here is the sequence of actions:
- type the address in the address bar of IE browser (e.g.
http://localhost/somesite/page.aspx
) --> this will execute the page load event and generate thetxt
file. - Delete the generated file above and In the same browser(page), re-type the same url (http://localhost/somesite/page.aspx) --> this will not execute the page load event and will not generate the
txt
file - Click the refresh button on the browser, now it executes the page load event and generates the
txt
file.
Why does the server not execute the Page_Load
event when the same page is re开发者_运维百科loaded without using the browser refresh button? Is this some sort of page level cache?
Try using a tool such as Fiddler to monitor the HTTP
requests and responses. Pay special attention to the Expires header. Step 2 probably doesn't even talk to the server since the page has not expired yet.
精彩评论