开发者

Server does not execute Page Load event when re-entering URL in browser

开发者 https://www.devze.com 2023-01-21 06:06 出处:网络
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:

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:

  1. 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 the txt file.
  2. 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
  3. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消