Click here to Skip to main content
15,896,606 members

Session Time out Problem in Asp.net......Please help

Software Engineer 892 asked:

Open original thread
Hello FRIENDS,

Have a good day all of you.

Facing trouble with session timeout.
----------------------------------

I have created a web application in Asp.net c#, Sql Server 2005.

but am facing a problem with session timeout.

my first page is login.aspx, this page is used to access/open the application.

after user login, if his/her username and password is correct. it will redirect to the main pages, here he will see/access all the webpages.

Suppose, if i stay idle for some time on this application....it shows an error.

THIS IS THE ERROR...

=================================================================

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 18: lblDate.Text = System.DateTime.Now.ToLongDateString();
Line 19: lblTime.Text = System.DateTime.Now.ToShortTimeString();
Line 20: lblWelcomeMSG.Text = Session["UserName"].ToString();
Line 21: }
Line 22: }

====================================================================

Please help me and SUGGEST me, how to solve me this problem.

Thanks in Advance.
Tags: C#, ASP.NET, SQL Server, Session

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900