|
 |
aspx thread: Session doesn't work
Message #1 by "Eka Gautama" <ekagautama@s...> on Tue, 5 Nov 2002 12:30:56 +0700
|
|
Hi All,
I have a page, let's say PageOne.aspx, that sets a session to value, once
session is stored then i redirect the page to PageTwo.aspx :
...
Session["OrderID"] = "001";
Response.Redirect("PageTwo.aspx");
...
Then, in PageTwo.aspx, I want to retrive the value in the session:
...
string x = Session["OrderID"].ToString();
...
But, it gives me an NullPointer exception because Session["OrderID"] is
null!!
Question is, why it becomes null ??
In web.config. I set cookiesless to false and mode to In Proc
Thank you
Eka
Message #2 by "Jay Warmack" <jwarmack@w...> on Tue, 5 Nov 2002 08:03:09 -0800
|
|
Make sure EnableSessionState="true" is set and also enable tracing for the
page (Trace='true") so that you can see the SessionID and the Session
variable in the trace results. Both of these can be set in the Page
Directive (@Page).
Jay
----- Original Message -----
From: "Eka Gautama" <ekagautama@s...>
To: "ASP.NET" <aspx@p...>
Sent: Monday, November 04, 2002 9:30 PM
Subject: [aspx] Session doesn't work
> Hi All,
>
> I have a page, let's say PageOne.aspx, that sets a session to value, once
> session is stored then i redirect the page to PageTwo.aspx :
>
> ...
> Session["OrderID"] = "001";
> Response.Redirect("PageTwo.aspx");
> ...
>
>
> Then, in PageTwo.aspx, I want to retrive the value in the session:
> ...
> string x = Session["OrderID"].ToString();
> ...
>
> But, it gives me an NullPointer exception because Session["OrderID"] is
> null!!
>
> Question is, why it becomes null ??
>
> In web.config. I set cookiesless to false and mode to In Proc
>
> Thank you
>
> Eka
>
>
>
>
>
>
> ---
>
> ASP.NET 1.0 Namespace Reference with C#
> http://www.wrox.com/acon11.asp?ISBN=1861007442
>
> ASP.NET 1.0 Namespace Reference with VB.NET
> http://www.wrox.com/acon11.asp?ISBN=1861007450
>
> These books are a complete reference to the ASP.NET namespaces
> for developers who are already familiar with using ASP.NET.
> There is no trivial introductory material or useless .NET
> hype and the presentation of the namespaces, in an easy-to use
> alphabetical order ensures a user-friendly reference format.
> We provide in-depth coverage of all the major ASP.NET classes,
> giving you those real-world tips that the documentation doesn't
> offer, and demonstrating complex techniques with simple
> examples.
>
> ---
>
|
|
 |