Click here to Skip to main content
15,851,242 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 29-Jan-17 15:49pm
v2

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

VB
- 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
 
Share this answer
 
Comments
Member 10316149 27-Jan-15 10:24am    
Thanks adams for your response, I use sessionstate but still not working. I think since the IIS application pool idletimeout is set to 5 minutes thats why Im getting the error when I post back to the server after an idle 5 minutes.
Is there anyway I overwrite the idletimeout in my web.config file.
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>


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

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

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"
) 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 .
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900