Click here to Skip to main content
12,634,101 members (26,480 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#3.0 C# ASP.NET
What are the possible ways to set session time out value for application other than 1.web.config(System.web), 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 29-Jan-13 5:24am
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

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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:

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:

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

Hope It'll help you.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.161208.2 | Last Updated 29 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100