问题描述
是我的网站。
一切正常,但我一直面临一个问题。
即如果我打开一页并且暂时没有做任何事情,有一段时间我做的话该页面中的一些活动显示以下错误....
www.ebsindiaonline.com
is my website.
everything is working fine but i have been facing one problem.
that is,if i open one page and did not do anything for a while,after sometime when i do some activities in that page it is showing the following error....
Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
注意:您看到的当前错误页面可以通过修改应用程序的< customerrors>的defaultRedirect属性来替换自定义错误页面。配置标记指向自定义错误页面URL。
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customerrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
推荐答案
string user = Session["User"].ToString();
或类似的东西,即假设你的会话变量总是被填充。您需要做的是更新代码以检查会话变量是否存在,如果不存在则会使您的网站优雅地降级。这取决于您的网站正在做什么,您可能希望让它们重新登录,或者返回到某个过程的开始以再次收集数据。
or something similar, ie assuming your session variables are always populated. What you need to do is update your code to check if the session variables exist or not, and if not do something that makes your site degrade gracefully. What that is depends on what your site is doing, you might want to make them re-login, or go back to the beginning of a certain process to gather the data again.
这篇关于如何制作永不超时的Asp页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!