Several ways:
1. You can change session timeout value in web.config. Example, if desired session timeout is 20 minutes, markup code in web.config should look like this:
<sessionstate timeout="60" mode="InProc""></sessionstate>
SessionState element is located under
<system.web></system.web>
namespace.
you can change ASP.NET session timeout programmatically
2. you can change session timeout from code. example, to decrease session time to 10 minutes, use:
Session.Timeout = 10;
3. One more way to change session timeout is using IIS Manager. Open Control Panel -> Administrative Tools -> IIS Manager -> Select desired web site -> in ASP.NET section on right side open Session State -> and finally, in text box named "Time-out (in minutes)" on the bottom of the form, change default value. This is the method if you use IIS 7, but it is similar for earlier versions too. On IIS 6, right click on selected website -> choose Properties -> in pop up dialog select ASP.NET tab -> and change timeout value.
4. if you use Forms Authentication, you'll probably need to increase forms timeout too, using markup code in web.config like this:
<system.web>
<authentication mode="Forms">
<forms timeout="60" />
</authentication>
Hope it helps