problem with expired session

G

Guest

Hi
I have some data driven pages with a datagrid set to allow paging. This is
working fine, the only problem is if a user left the browser at such page,
and after the session expired the user click on the page number again, this
will trigger a postback but some of the required session variable has been
destroyed along with the cookie (I guess), then an error of "Null Object
reference" will be thrown!!

What is the best way to prevent such error, please?!
Would it be enough to just check User.Identity.IsAuthenticated ?

TIA


--
 
B

Brock Allen

You should code defensively -- check for null (or Nothing) and if you code
can't continue processing then do a Response.Redirect to a page where the
user can start all over again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top