天天看點

.NET驗證碼頁出錯

.NET驗證碼頁出現如果下錯誤.處理方法.

登入Server Error in '/' Application.

--------------------------------------------------------------------------------

Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection. If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name.

背景時很短的時間就傳回到了登入界面。

開啟ASP.NET State Service服務,把它設成自動。再在web.config中的<system.web>下加一行<sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" timeout="20"/>,如下

一、開啟ASP.NET State Service服務:

選擇管理工具->服務,找到ASP.NET State Service,點開後選擇啟動,并将啟動類型設為自動。

二、設定程式配置檔案:

将web.config打開,會看到有一行是<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" timeout="20"/>,如果沒有,請在<system.web>的下一行添加,再将其中的InProc改為StateServer,儲存即可。(注:如果不修改,背景登入驗證狀态将會時斷時續,表現在很短的時間内就出現重新登入框)

**************************

如果不行嘗試一下方法:

在web.config中有,<sessionState mode="StateServer"/>

這是session儲存的方式,你現在標明的方式是stateserver,這是個"服務",但它預設不開啟.

解決方法:

1.<sessionState mode="StateServer"/>改為<sessionState mode="InProc"/>

2.打開asp.net狀态服務

"管理工具"->"服務"->"ASP.NET 狀态服務"->啟動

本文轉自94cool部落格園部落格,原文連結:http://www.cnblogs.com/94cool/archive/2010/04/12/1710204.html,如需轉載請自行聯系原作者 

繼續閱讀