(一)、在web.Config檔案中的System.Web節下進行配置:
<sessionState timeout="30" mode="InProc"></sessionState>
(二)、增加一個頁面用于重新整理頁面,強制讓Session繼續生效。
第一步:
建立一個空白頁面AutoRefresh.aspx,在<HEAD></HEAD>加入
<script type="text/javascript">setTimeout("location.href='AutoRefresh.aspx' ",120000)</script>
120000代表2分鐘自動重新整理一次
第二步:
将這個頁面'AutoRefresh.aspx' 用架構包含到顯示的首頁面内就可以了
<iframe width="1" height="1" src="AutoRefresh.aspx"></iframe>