在iis应用程序池空闲超时上重新加载页面 [英] reload a page on iis application pool idle timeout

查看:64
本文介绍了在iis应用程序池空闲超时上重新加载页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我离开我的网页后点击altton大约5

分钟并且任何respondse.redirect重置时间时,我收到此错误。

我主持一个godaddy共享主机方案并且无法更改iis应用程序池空闲超时(这是5分钟)

i希望页面刷新时发生此错误而不是自定义错误页面

错误:

I get this error when I click on abutton after leaving my webpage on for about 5
minutes and any respondse.redirect resets the time.
Im hosting on a godaddy shared hosting plan and cannot change the iis application pool idle timeout (which is 5 minutes)
i want the page to refresh when ever this error occurs instead of the custom error page
error:

Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

推荐答案

您是否使用会话?基本上,共享主机不允许使用会话,因为它会影响该服务器上的其他客户端站点。作为替代方案,您可以使用ASP.NET会话状态。请参考



Do you use session? Basically, shared hosting dont permit to use session as it will impact to other clients site on that server. As an alternative you can use ASP.NET session state. Please refer to

- http://blogs.msdn.com/b/johan/archive/2006/11/20/sessionstate-performance.aspx
- http://forums.asp.net/t/1803857.aspx/1?Session+out+frequently+in+asp+net+
- http://msdn.microsoft.com/en-us/library/ms972429.aspx


我和godaddy有同样的问题,我通过这个解决方案解决了这个问题:





1 - 在你的site.master页面创建一个更新面板,并在你的标记页面中以此间隔输入计时器,如下所示:

I have the same problem with godaddy and i solved it by this solution :


1 - In your site.master page create an updatepanel and put in it timer with this interval in your markup page, like this :
<asp:UpdatePanel ID="uppLiveTime" runat="server" RenderMode="Block" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Timer ID="tmrLiveTime" runat="server" Interval="270000"></asp:Timer>
        </ContentTemplate>
</asp:UpdatePanel>





此区间为:1000 * 60(计时器1秒= 1000 * 60将它转换为1分钟)* 4.5

finally = 1 * 1000 * 4.5 = 270000这意味着计时器将每4.5分钟触发一次Tick事件。





2 - 在Tick事件代码后面,更新updatepanel,如下所示:



this interval is : 1000 * 60 (in timer 1 second = 1000 * 60 to convert it to 1 minute) * 4.5
finally = 1 * 1000 * 4.5 = 270000 that means the timer will fire the Tick Event every 4.5 minutes .


2 - inside the Tick event code behind, update the updatepanel like this :

Private Sub tmrLiveTime_Tick(sender As Object, e As EventArgs) Handles tmrLiveTime.Tick
        On Error Resume Next
        uppLiveTime.Update()
 End Sub



这将更新你的更新面板并部分刷新页面(不重新加载)。



3 - 在Page_load事件中,再次禁用并启用计时器,如下所示:


This will update your update panel and partial refresh your page (not reloading) .

3 - In your Page_load event, disable and enable the timer again, like this :

Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        tmrLiveTime.Enabled = False
        tmrLiveTime.Enabled = True
    End Sub



这将重新启动计时器操作离子以确保当用户从一个页面重定向到另一个页面时,计时器仍在工作。



注意:请勿更改UPDATEPANEL设置并确认UPDATEPANEL模式必须是(


this will restart the timer operations to be sure that when the user redirect from page to page, the timer still working .

Note : DON'T CHANGE THE UPDATEPANEL SETTINGS AND MAKE SURE THAT THE UPDATEPANEL MODE MUST BE (

UpdateMode="Conditional"

)要正确运行



我解决了我在godaddy的问题asp.net应用程序通过这种方式运行成功,我的应用程序现在没有超时。



抱歉如果我的英语不好,但我想帮忙你,谢谢。

) TO RUN CORRECTLLY

I solved my problem with godaddy in my asp.net application by this way and run successfully, and my app have no timeout right now.

and sorry if my english is not good, but i want to help you, Thanks .


这篇关于在iis应用程序池空闲超时上重新加载页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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