This is a migrated thread and some comments may be shown as answers.

Urgent:Session TimeOut

3 Answers 392 Views
PageLayout
This is a migrated thread and some comments may be shown as answers.
Pravallika
Top achievements
Rank 1
Pravallika asked on 08 Jul 2014, 05:55 AM
Hai All,

I am facing one problem in my website i am having one default.aspx page its not inheriting master page what i need when i open my site it will expire after 6mins for me whats happening for every pages its working fine every page is inheriting master page but this default.aspx is not inheriting master page so when i open default.aspx and doing something also its showing time out.so now i want to stop master page session time in this defult.aspx how to do.here i dont want to inherit master page and recreate bcz if i inherit master page so many issues will come so other than any solution is there plz tel me its urgent



Thanks  

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 08 Jul 2014, 07:30 AM
Hi Pravallika,

As a suggestion please try to set the Session Time out in the MasterPage Page_Load event. Whenever a Content Page is loading, the master page load event will fire and the all content page will have same session timeout. In the case of Default page you can extend the session time out to one large value. So the session will not clear for a long time.

Thanks,
Shinu.
0
Pravallika
Top achievements
Rank 1
answered on 08 Jul 2014, 08:33 AM
var timoutWarning = 60000; // Display warning in 5Mins.
        var timoutNow = 120000; // Timeout in 6 mins.
        var logoutUrl = '../../Login.aspx';
        var warningTimer;
        var timeoutTimer;
 
        // Start timers.
        function StartTimers() {
            
            warningTimer = setTimeout("IdleWarning()", timoutWarning);
            timeoutTimer = setTimeout("IdleTimeout()", timoutNow);
        }
and masterpage body load event we are starting timer so now wen i open my default page in a radwindow thru client button click of master page even wen default.aspx page is opened and iam working on it session pop up comes because on backgorund master page is opened and is idle so pop up comes... so plz help me out in implementing session pop up for my default.aspx
0
Shinu
Top achievements
Rank 2
answered on 09 Jul 2014, 06:27 AM
Hi Pravallika,

In your scenario you can change the session time out on the Default page and when closing the RadWindow try to reset the session timeout to original value. Please have a look into the sample code snippet which works fine at my end.

Master Page:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" OnClientClose="setSessionTime">
</telerik:RadWindowManager>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
</telerik:RadAjaxManager>
<telerik:RadButton ID="rbtnOpenWin" runat="server" Text="Open Window" AutoPostBack="false"
    OnClientClicked="openWin">
</telerik:RadButton>

Master Page C#:
protected void Page_Load(object sender, EventArgs e)
{
    Session.Timeout = 1;
    Session["Demo"] = label1.Text;
}
protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
{
    Session.Timeout = 1;
}

Master Page JavaScript:
function openWin(sender, args) {
    radopen("Default.aspx", "RadWindow");
}
function setSessionTime(sender, args) {
    $find("<%=RadAjaxManager1.ClientID%>").ajaxRequest();
}

Default Page C#:
protected void Page_Load(object sender, EventArgs e)
{
    Session.Timeout = 40000;
}

Thanks,
Shinu.
Tags
PageLayout
Asked by
Pravallika
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Pravallika
Top achievements
Rank 1
Share this question
or