2 つのページを持つ単純な ASP.NET 3.5 Web アプリを作成しました。各ページには、時間を表示するラベルとポストバックするボタンがあります。各ページの Page_Load には、次のものがあります。
Response.ClearHeaders();
Response.AppendHeader("Cache-Control", "no-cache"); //HTTP 1.1
Response.AppendHeader("Cache-Control", "private"); // HTTP 1.1
Response.AppendHeader("Cache-Control", "no-store"); // HTTP 1.1
Response.AppendHeader("Cache-Control", "must-revalidate"); // HTTP 1.1
Response.AppendHeader("Cache-Control", "max-stale=0"); // HTTP 1.1
Response.AppendHeader("Cache-Control", "post-check=0"); // HTTP 1.1
Response.AppendHeader("Cache-Control", "pre-check=0"); // HTTP 1.1
Response.AppendHeader("Pragma", "no-cache"); // HTTP 1.1
Response.AppendHeader("Keep-Alive", "timeout=3, max=993"); // HTTP 1.1
Response.AppendHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT"); // HTTP 1.1
ユーザーが [戻る] ボタンをクリックした場合に、「ページの有効期限が切れています」というメッセージを表示させたい。ただし、何が起こっているかというと、[戻る] ボタンが前のページを表示しており、キャッシュからプルするのではなく、ページを更新しています。ラベルは現在の時刻で更新されます。ページを更新したくありませんが、代わりに「ページの有効期限が切れています」というメッセージを表示します。どうすればそれを強制できますか?IE9 を使用してこれをテストしましたが、すべてのブラウザーで同じ動作が必要です。