Re: session object: simple question

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Thomas Dodds (thomasdodds_at_hotmail.com)
Date: 08/31/04


Date: Tue, 31 Aug 2004 10:33:07 -0400

int iProposalId = Session["ProposalId"];

you could then test: IsNothing(iProposalId)

"Nikhil Patel" <nikhil0100@aol.com> wrote in message news:uObhIV2jEHA.2948@TK2MSFTNGP11.phx.gbl...
> Hi all,
> I am using a Session object in my ASP.Net application to store a value of
> a Database field. I can access it as ...
> int iProposalId = Session["ProposalId"];
>
> The session timeout is set to 20. Now my question is if the session expires,
> would the above statement produce any exception? If I can't find the
> ProposalId value in the session object, I would like to display a message to
> the user and close the window.
>
> Thanks.
> -Nikhil
>
>



Relevant Pages