Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What are the possible ways to set session time out value for asp.net application other than 1.web.config(System.web), 2.global.asax and 3.IIS(ASP.NET-->state mgmt-->edit configurations-->session timeout. Actually im working in a maintance and support project. We need to resolve one issue ie end user is getting timed out for every 2 mins when he is submitting details. So he requested us to increse session time out value to 5 mins, but we are unable to find where that session time out value is set for that application(session time out not there in web.config, global.asax and 20 mins in IIS Server)
Any help would be appreciated
Posted
Comments
Sandeep Mewara 29-Jan-13 12:08pm    
What kind of details is your client submitting? Is it huge data? Does that take more than 2 min ?

Further, is the behavior with everyone or just one client?
Member 9394377 30-Jan-13 7:15am    
That page has just 7 fields, depends on data some times that will not take more than 2 mins. I did not find Session.Timeout value in pageload and button_click events. If i want to change session time out value where can i find that?
Sandeep Mewara 30-Jan-13 9:21am    
7 fields and can take more than 2 min sometimes? sure?

1 solution

You can set Session Timeout inside any Event in a Page.
For example if you want to set Session Timeout for a particular page, then simply write down the following Code inside Page_Load Event of that particular page:

C#
protected void Page_Load(object sender, EventArgs e)
    {
        //Setting Session Timeout to 30 Mnts
        Session.Timeout = 1800;
    }


And if you want to set Session Timeout when user Clicks a particular Button or Any Control, the simple you can Set Timeout property of Session inside any Control Event as per your Requirement.For Example see below.I'm Setting timeout property inside Button_Click event:

C#
protected void Button1_Click(object sender, EventArgs e)
    {
        //Setting Session Timeout to 30 Mnts
        Session.Timeout = 1800;
    }


Hope It'll help you.
 
Share this answer
 

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