我是新來的asp.net ..請幫助我編寫代碼來設置會話超時以及如何在所有頁面中實現,我嘗試了使用web配置方法,但沒有得到,我接近截止日期。 這是我的代碼 如何在asp.net中編寫會話超時
0
A
回答
2
從代碼:
Session.Timeout = 60; // this will set 60 min timout
從配置:
<sessionState timeout="60" />
1
使用Web.config
<sessionState
timeout="number of minutes"............
完全參考HERE!
或
使用Forms authentication
<system.web>
<authentication mode="Forms">
<forms timeout="50"/>
</authentication>
<sessionState timeout="60" />
</system.web>
+0
謝謝..但我有一個更多的懷疑...它會適用於所有頁面,我需要做aspx.cs頁面的任何編碼..請稍等 – user2637192
相關問題
- 1. ASP.NET - 會話超時
- 2. 會話ASP.NET超時
- 3. 會話超時ASP.Net
- 4. ASP.NET中的會話超時
- 5. 會話超時在ASP.Net
- 6. 在ASP.NET MVC會話超時
- 7. 在asp.net mvc4中設置會話超時?
- 8. 在ASP.NET中的會話超時警告
- 9. 在asp.net中防止會話超時mvc
- 10. 在ASP.NET MVC中處理會話超時
- 11. 會話超時在Asp.Net中延伸
- 12. 在asp.net中的會話超時mvc
- 13. 會話超時絕不會在asp.net mvc
- 14. 如何在asp.net中延長會話超時時間
- 15. ASP.NET會話超時提前
- 16. asp.net mvc會話超時
- 17. 會話超時asp.net iis7?
- 18. ASP.NET會話超時太早
- 19. ASP.Net會話超時場景
- 20. ASP.NET 2.0會話超時
- 21. 會話超時提示asp.net
- 22. 擴展Asp.net會話超時
- 23. Asp.net - 會話超時Windows
- 24. ASP.NET會話超時測試
- 25. ASP.Net會話超時問題
- 26. ASP.NET會話提前超時
- 27. asp.net 2.0會話超時
- 28. ASP.NET會話超時意外
- 29. ASP.NET MVC 4會話超時
- 30. 會話超時asp.net iis7
哪裏是代碼,什麼d身份證你試試,你是什麼我和「但沒有得到」?你有沒有激活會話狀態?默認的超時時間爲20分鐘,所以您應該能夠讀取您在Session狀態下存儲的至少20分鐘的任何內容。如果你不能或者你的代碼是錯誤的,或者你根本沒有激活會話狀態。 –
[ASP.NET中的會話超時]的可能重複(http://stackoverflow.com/questions/648992/session-timeout-in-asp-net) –
在連接字符串中添加timeout = 2000。 – Janki