I have a webpage where I want the typed in data to auto save. For that I use the ASP.NET timer. But my problem is I still want my session yo timeout due to inactivity, so can i make the timer call the tick without refreshing the session time?
Here is the code, sorry but i could no upload picture yet :=
<form runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Timer ID="SaveTimer" runat="server" Interval="150000"
ontick="SaveTimer_Tick">
</asp:Timer>
<asp:UpdatePanel runat="server" updatemode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger controlid="SaveTimer"
eventname="Tick" />
</Triggers>
<ContentTemplate>
</ContentTemplate>
</asp:UpdatePanel>
What I think you want is to keep the session alive as long as the user is working on that page. When you don’t trigger the auto save option, when there are no changes, you won’t go back to the server and thus not update the session. In that case, the session will time out eventually when the user stops working on that page.
So again, only call back to the server when there are actually changes to be saved.