如何制作永不超时的Asp页面 [英] How Do I Make A Asp Page Which Will Never Timedout

查看:124
本文介绍了如何制作永不超时的Asp页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



www.ebsindiaonline.com

是我的网站。

一切正常,但我一直面临一个问题。

即如果我打开一页并且暂时没有做任何事情,有一段时间我做的话该页面中的一些活动显示以下错误....






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>

推荐答案

为了看到正确的错误你需要做的是指示和更新你的web.config。



其次,解决方案你的问题不是让一个永远不会超时的页面,因为这是不可能的,它会耗尽你所有服务器的资源。解决方案是修复代码,使会话超时时不会出错。当你关闭自定义错误时,你会看到真正的问题,但我怀疑你正在做的事情



In order to see the proper error you need to do what that is instructing and update your web.config.

Secondly, the solution to your problem is not to make a page that never times out as that is impossible, it would use up all your server's resources. The solution is to fix your code such that it doesn't error when the session times out. When you turn off custom errors you'll see the real problem, but I suspect you are doing things like

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页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆