You need to :
1. include a <pages... > attribute in web.config :
<pages enableSessionState = "true" />
*or*
2. enable SessionState in the <%@ Page ...%> directive in your page :
<%@ Page enableSessionState = "true" %>
Also, the System.Web.SessionStateModule should exist in your
<httpModules> section in the application configuration.
Unless you've erased it, it should be there.
Juan T. Llibre, asp.net MVP
aspnetfaq.com :
http://www.aspnetfaq.com/
asp.net faq :
http://asp.net.do/faq/
foros de asp.net, en espaņol :
http://asp.net.do/foros/
===================================
<> wrote in message
news: ups.com...
> Thanks for your reply. Unfortunately, your suggestion did not work.
> Here's the exact error message (using my original code):
>
> Session state can only be used when enableSessionState is set to true,
> either in a configuration file or in the Page directive. Please also
> make sure that System.Web.SessionStateModule or a custom session state
> module is included in the <configuration>\<system.web>\<httpModules>
> section in the application configuration.
> 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.Web.HttpException: Session state can only be
> used when enableSessionState is set to true, either in a configuration
> file or in the Page directive. Please also make sure that
> System.Web.SessionStateModule or a custom session state module is
> included in the <configuration>\<system.web>\<httpModules> section in
> the application configuration.
>
> Source Error:
>
>
> Line 89: {
> Line 90:
> Line 91: ArrayList cart = (ArrayList)Session["Cart"];
> Line 92:
> Line 93: if (cart != null)
>