By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,275 Members | 920 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,275 IT Pros & Developers. It's quick & easy.

Cannot get Session State to work

P: n/a
I've been on this for a while, and cannot figure it out. Can someone please
help with this message?

SessionState 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><httpModulessection in the application
configuration.

Here is my current web.config file

<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="ReportServer" value="https://myserver/reportserver?/" />
</appSettings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authenticationsection enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows">
<forms loginUrl="Index.aspx"
cookieless="UseUri" />
</authentication>
<authorization>
<allow users="*" />
</authorization>
<!--
The <customErrorssection enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
<customErrors mode="Off">
</customErrors>
<trust level="Full" originUrl="" />

<httpModules>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</httpModules>

<!-- Enable session state for all the pages in the Web application. -->
<pages>
<controls>

<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>

</system.web>
</configuration>

Nov 16 '07 #1
Share this Question
Share on Google+
10 Replies


P: n/a
InProc Session State is enabled by default in ASP.NET 2.0 You do not need any
entries at all in the Web.config.

--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com

"Wannabe" wrote:
I've been on this for a while, and cannot figure it out. Can someone please
help with this message?

SessionState 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><httpModulessection in the application
configuration.

Here is my current web.config file

<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="ReportServer" value="https://myserver/reportserver?/" />
</appSettings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authenticationsection enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows">
<forms loginUrl="Index.aspx"
cookieless="UseUri" />
</authentication>
<authorization>
<allow users="*" />
</authorization>
<!--
The <customErrorssection enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
<customErrors mode="Off">
</customErrors>
<trust level="Full" originUrl="" />

<httpModules>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</httpModules>

<!-- Enable session state for all the pages in the Web application. -->
<pages>
<controls>

<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>

</system.web>
</configuration>
Nov 16 '07 #2

P: n/a
Not sure what you mean, but I do not have an InProc entry in my web.config
file.

"Peter Bromberg [C# MVP]" wrote:
InProc Session State is enabled by default in ASP.NET 2.0 You do not need any
entries at all in the Web.config.

--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com

"Wannabe" wrote:
I've been on this for a while, and cannot figure it out. Can someone please
help with this message?

SessionState 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><httpModulessection in the application
configuration.

Here is my current web.config file

<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="ReportServer" value="https://myserver/reportserver?/" />
</appSettings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authenticationsection enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows">
<forms loginUrl="Index.aspx"
cookieless="UseUri" />
</authentication>
<authorization>
<allow users="*" />
</authorization>
<!--
The <customErrorssection enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
<customErrors mode="Off">
</customErrors>
<trust level="Full" originUrl="" />

<httpModules>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</httpModules>

<!-- Enable session state for all the pages in the Web application. -->
<pages>
<controls>

<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>

</system.web>
</configuration>
Nov 16 '07 #3

P: n/a
re:
!Not sure what you mean, but I do not have an InProc entry in my web.config file.

InProc is *also* the default.

If you want to disable SessionState *or* enable a different sessionState
management mode, other than InProc, you'll need to explicitly set those options.

Check to see if :

<section name="sessionState" type="System.Web.Configuration.SessionStateSection , System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />

....is in your machine.config file...it should be there.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espańol : http://asp.net.do/foros/
======================================
"Wannabe" <Wa*****@discussions.microsoft.comwrote in message
news:FF**********************************@microsof t.com...
Not sure what you mean, but I do not have an InProc entry in my web.config
file.

"Peter Bromberg [C# MVP]" wrote:
>InProc Session State is enabled by default in ASP.NET 2.0 You do not need any
entries at all in the Web.config.

--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com

"Wannabe" wrote:
I've been on this for a while, and cannot figure it out. Can someone please
help with this message?

SessionState 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><httpModulessection in the application
configuration.

Here is my current web.config file

<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="ReportServer" value="https://myserver/reportserver?/" />
</appSettings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authenticationsection enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows">
<forms loginUrl="Index.aspx"
cookieless="UseUri" />
</authentication>
<authorization>
<allow users="*" />
</authorization>
<!--
The <customErrorssection enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
<customErrors mode="Off">
</customErrors>
<trust level="Full" originUrl="" />

<httpModules>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</httpModules>

<!-- Enable session state for all the pages in the Web application. -->
<pages>
<controls>

<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>

</system.web>
</configuration>

Nov 16 '07 #4

P: n/a
I checked, and that entry is in my machine.config file. I still get the same
error about session state.

"Juan T. Llibre" wrote:
re:
!Not sure what you mean, but I do not have an InProc entry in my web.config file.

InProc is *also* the default.

If you want to disable SessionState *or* enable a different sessionState
management mode, other than InProc, you'll need to explicitly set those options.

Check to see if :

<section name="sessionState" type="System.Web.Configuration.SessionStateSection , System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />

....is in your machine.config file...it should be there.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaƱol : http://asp.net.do/foros/
======================================
"Wannabe" <Wa*****@discussions.microsoft.comwrote in message
news:FF**********************************@microsof t.com...
Not sure what you mean, but I do not have an InProc entry in my web.config
file.

"Peter Bromberg [C# MVP]" wrote:
InProc Session State is enabled by default in ASP.NET 2.0 You do not need any
entries at all in the Web.config.

--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com

"Wannabe" wrote:

I've been on this for a while, and cannot figure it out. Can someone please
help with this message?

SessionState 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><httpModulessection in the application
configuration.

Here is my current web.config file

<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="ReportServer" value="https://myserver/reportserver?/" />
</appSettings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authenticationsection enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows">
<forms loginUrl="Index.aspx"
cookieless="UseUri" />
</authentication>
<authorization>
<allow users="*" />
</authorization>
<!--
The <customErrorssection enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
<customErrors mode="Off">
</customErrors>
<trust level="Full" originUrl="" />

<httpModules>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</httpModules>

<!-- Enable session state for all the pages in the Web application. -->
<pages>
<controls>

<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>

</system.web>
</configuration>


Nov 16 '07 #5

P: n/a
In my web.config, that was posted with my original quesiton, I have a
reference to Ajax, which I just added to my site. If I remove that and add
the below statement, my Session State works. How can I work this into my
web.config file? I've tried many combinations, but none worked. Or am I
looking in the wrong direction on how to fix this?

<pages enableSessionState="true" enableViewState="true"
enableViewStateMac="true" validateRequest="false" />

"Juan T. Llibre" wrote:
re:
!Not sure what you mean, but I do not have an InProc entry in my web.config file.

InProc is *also* the default.

If you want to disable SessionState *or* enable a different sessionState
management mode, other than InProc, you'll need to explicitly set those options.

Check to see if :

<section name="sessionState" type="System.Web.Configuration.SessionStateSection , System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />

....is in your machine.config file...it should be there.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaƱol : http://asp.net.do/foros/
======================================
"Wannabe" <Wa*****@discussions.microsoft.comwrote in message
news:FF**********************************@microsof t.com...
Not sure what you mean, but I do not have an InProc entry in my web.config
file.

"Peter Bromberg [C# MVP]" wrote:
InProc Session State is enabled by default in ASP.NET 2.0 You do not need any
entries at all in the Web.config.

--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com

"Wannabe" wrote:

I've been on this for a while, and cannot figure it out. Can someone please
help with this message?

SessionState 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><httpModulessection in the application
configuration.

Here is my current web.config file

<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="ReportServer" value="https://myserver/reportserver?/" />
</appSettings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authenticationsection enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows">
<forms loginUrl="Index.aspx"
cookieless="UseUri" />
</authentication>
<authorization>
<allow users="*" />
</authorization>
<!--
The <customErrorssection enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
<customErrors mode="Off">
</customErrors>
<trust level="Full" originUrl="" />

<httpModules>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</httpModules>

<!-- Enable session state for all the pages in the Web application. -->
<pages>
<controls>

<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>

</system.web>
</configuration>


Nov 16 '07 #6

P: n/a
Try this :

<sessionState mode="InProc" cookieless="false" regenerateExpiredSessionId="false" timeout="20" />

If you don't mind Session ID's being reused, you can do with :

<sessionState mode="InProc" cookieless="false" timeout="20" />

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espańol : http://asp.net.do/foros/
======================================
"Wannabe" <Wa*****@discussions.microsoft.comwrote in message
news:52**********************************@microsof t.com...
In my web.config, that was posted with my original quesiton, I have a
reference to Ajax, which I just added to my site. If I remove that and add
the below statement, my Session State works. How can I work this into my
web.config file? I've tried many combinations, but none worked. Or am I
looking in the wrong direction on how to fix this?

<pages enableSessionState="true" enableViewState="true"
enableViewStateMac="true" validateRequest="false" />

"Juan T. Llibre" wrote:
>re:
!Not sure what you mean, but I do not have an InProc entry in my web.config file.

InProc is *also* the default.

If you want to disable SessionState *or* enable a different sessionState
management mode, other than InProc, you'll need to explicitly set those options.

Check to see if :

<section name="sessionState" type="System.Web.Configuration.SessionStateSection , System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />

....is in your machine.config file...it should be there.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espańol : http://asp.net.do/foros/
======================================
"Wannabe" <Wa*****@discussions.microsoft.comwrote in message
news:FF**********************************@microso ft.com...
Not sure what you mean, but I do not have an InProc entry in my web.config
file.

"Peter Bromberg [C# MVP]" wrote:

InProc Session State is enabled by default in ASP.NET 2.0 You do not need any
entries at all in the Web.config.

--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com

"Wannabe" wrote:

I've been on this for a while, and cannot figure it out. Can someone please
help with this message?

SessionState 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><httpModulessection in the application
configuration.

Here is my current web.config file

<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="ReportServer" value="https://myserver/reportserver?/" />
</appSettings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authenticationsection enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows">
<forms loginUrl="Index.aspx"
cookieless="UseUri" />
</authentication>
<authorization>
<allow users="*" />
</authorization>
<!--
The <customErrorssection enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
<customErrors mode="Off">
</customErrors>
<trust level="Full" originUrl="" />

<httpModules>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</httpModules>

<!-- Enable session state for all the pages in the Web application. -->
<pages>
<controls>

<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>

</system.web>
</configuration>



Nov 16 '07 #7

P: n/a
That did not work. The only thing that works is the original line that I had
before I added Ajax entries. See below...

Original (Session state works, but I get a sys not defined on my Ajax pages):
<pages enableSessionState="true" enableViewState="true"
enableViewStateMac="true" validateRequest="false" />

Ajax Version (Ajax works, but now my Session State does not work):
<pages>
<controls>
<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>

How can I incorporate the original session entry with the Ajax entries, and
have both things working at the same time?

Thanks a lot for your help.

"Juan T. Llibre" wrote:
Try this :

<sessionState mode="InProc" cookieless="false" regenerateExpiredSessionId="false" timeout="20" />

If you don't mind Session ID's being reused, you can do with :

<sessionState mode="InProc" cookieless="false" timeout="20" />

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaƱol : http://asp.net.do/foros/
======================================
"Wannabe" <Wa*****@discussions.microsoft.comwrote in message
news:52**********************************@microsof t.com...
In my web.config, that was posted with my original quesiton, I have a
reference to Ajax, which I just added to my site. If I remove that and add
the below statement, my Session State works. How can I work this into my
web.config file? I've tried many combinations, but none worked. Or am I
looking in the wrong direction on how to fix this?

<pages enableSessionState="true" enableViewState="true"
enableViewStateMac="true" validateRequest="false" />

"Juan T. Llibre" wrote:
re:
!Not sure what you mean, but I do not have an InProc entry in my web.config file.

InProc is *also* the default.

If you want to disable SessionState *or* enable a different sessionState
management mode, other than InProc, you'll need to explicitly set those options.

Check to see if :

<section name="sessionState" type="System.Web.Configuration.SessionStateSection , System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />

....is in your machine.config file...it should be there.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaƱol : http://asp.net.do/foros/
======================================
"Wannabe" <Wa*****@discussions.microsoft.comwrote in message
news:FF**********************************@microsof t.com...
Not sure what you mean, but I do not have an InProc entry in my web.config
file.

"Peter Bromberg [C# MVP]" wrote:

InProc Session State is enabled by default in ASP.NET 2.0 You do not need any
entries at all in the Web.config.

--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com

"Wannabe" wrote:

I've been on this for a while, and cannot figure it out. Can someone please
help with this message?

SessionState 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><httpModulessection in the application
configuration.

Here is my current web.config file

<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="ReportServer" value="https://myserver/reportserver?/" />
</appSettings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authenticationsection enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows">
<forms loginUrl="Index.aspx"
cookieless="UseUri" />
</authentication>
<authorization>
<allow users="*" />
</authorization>
<!--
The <customErrorssection enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
<customErrors mode="Off">
</customErrors>
<trust level="Full" originUrl="" />

<httpModules>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</httpModules>

<!-- Enable session state for all the pages in the Web application. -->
<pages>
<controls>

<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>

</system.web>
</configuration>



Nov 16 '07 #8

P: n/a
Original (Session state works, but I get a sys not defined on my Ajax
pages):
<pages enableSessionState="true" enableViewState="true"
enableViewStateMac="true" validateRequest="false" />

Ajax Version (Ajax works, but now my Session State does not work):
<pages>
<controls>
<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>

How can I incorporate the original session entry with the Ajax entries,
and
have both things working at the same time?

Just a guess, but maybe just add the attributes from your original "pages"
element to the working AJAX config like this:

<pages enableSessionState="true" enableViewState="true"
enableViewStateMac="true" validateRequest="false">
<controls>
<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>

Nov 16 '07 #9

P: n/a
That's actually pretty easy Wannabe...

Try this:

<pages enableSessionState="true" enableViewState="true"
enableViewStateMac="true" validateRequest="false">
<controls>
<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>
"Wannabe" wrote:
That did not work. The only thing that works is the original line that I had
before I added Ajax entries. See below...

Original (Session state works, but I get a sys not defined on my Ajax pages):
<pages enableSessionState="true" enableViewState="true"
enableViewStateMac="true" validateRequest="false" />

Ajax Version (Ajax works, but now my Session State does not work):
<pages>
<controls>
<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>

How can I incorporate the original session entry with the Ajax entries, and
have both things working at the same time?

Thanks a lot for your help.

"Juan T. Llibre" wrote:
Try this :

<sessionState mode="InProc" cookieless="false" regenerateExpiredSessionId="false" timeout="20" />

If you don't mind Session ID's being reused, you can do with :

<sessionState mode="InProc" cookieless="false" timeout="20" />

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaƱol : http://asp.net.do/foros/
======================================
"Wannabe" <Wa*****@discussions.microsoft.comwrote in message
news:52**********************************@microsof t.com...
In my web.config, that was posted with my original quesiton, I have a
reference to Ajax, which I just added to my site. If I remove that and add
the below statement, my Session State works. How can I work this into my
web.config file? I've tried many combinations, but none worked. Or am I
looking in the wrong direction on how to fix this?
>
<pages enableSessionState="true" enableViewState="true"
enableViewStateMac="true" validateRequest="false" />
>
"Juan T. Llibre" wrote:
>
>re:
>!Not sure what you mean, but I do not have an InProc entry in my web.config file.
>>
>InProc is *also* the default.
>>
>If you want to disable SessionState *or* enable a different sessionState
>management mode, other than InProc, you'll need to explicitly set those options.
>>
>Check to see if :
>>
><section name="sessionState" type="System.Web.Configuration.SessionStateSection , System.Web,
>Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
>>
>....is in your machine.config file...it should be there.
>>
>>
>>
>Juan T. Llibre, asp.net MVP
>asp.net faq : http://asp.net.do/faq/
>foros de asp.net, en espaƱol : http://asp.net.do/foros/
>======================================
>"Wannabe" <Wa*****@discussions.microsoft.comwrote in message
>news:FF**********************************@microso ft.com...
Not sure what you mean, but I do not have an InProc entry in my web.config
file.
>
"Peter Bromberg [C# MVP]" wrote:
>
>InProc Session State is enabled by default in ASP.NET 2.0 You do not need any
>entries at all in the Web.config.
>>
>--Peter
>"Inside every large program, there is a small program trying to get out."
>http://www.eggheadcafe.com
>http://petesbloggerama.blogspot.com
>http://www.blogmetafinder.com
>>
>>
>>
>"Wannabe" wrote:
>>
I've been on this for a while, and cannot figure it out. Can someone please
help with this message?
>
SessionState 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><httpModulessection in the application
configuration.
>
Here is my current web.config file
>
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="ReportServer" value="https://myserver/reportserver?/" />
</appSettings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authenticationsection enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows">
<forms loginUrl="Index.aspx"
cookieless="UseUri" />
</authentication>
<authorization>
<allow users="*" />
</authorization>
<!--
The <customErrorssection enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
<customErrors mode="Off">
</customErrors>
<trust level="Full" originUrl="" />
>
<httpModules>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</httpModules>
>
<!-- Enable session state for all the pages in the Web application. -->
<pages>
<controls>
>
<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>
>
</system.web>
</configuration>
>
>>
>>
>>
Nov 16 '07 #10

P: n/a
Thanks a lot...I am working on this all day, then all the sudden get two good
answers Thanks again Mike and Scott.

"Mike Collins" wrote:
That's actually pretty easy Wannabe...

Try this:

<pages enableSessionState="true" enableViewState="true"
enableViewStateMac="true" validateRequest="false">
<controls>
<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>
"Wannabe" wrote:
That did not work. The only thing that works is the original line that I had
before I added Ajax entries. See below...

Original (Session state works, but I get a sys not defined on my Ajax pages):
<pages enableSessionState="true" enableViewState="true"
enableViewStateMac="true" validateRequest="false" />

Ajax Version (Ajax works, but now my Session State does not work):
<pages>
<controls>
<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>

How can I incorporate the original session entry with the Ajax entries, and
have both things working at the same time?

Thanks a lot for your help.

"Juan T. Llibre" wrote:
Try this :
>
<sessionState mode="InProc" cookieless="false" regenerateExpiredSessionId="false" timeout="20" />
>
If you don't mind Session ID's being reused, you can do with :
>
<sessionState mode="InProc" cookieless="false" timeout="20" />
>
>
>
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaƱol : http://asp.net.do/foros/
======================================
"Wannabe" <Wa*****@discussions.microsoft.comwrote in message
news:52**********************************@microsof t.com...
In my web.config, that was posted with my original quesiton, I have a
reference to Ajax, which I just added to my site. If I remove that and add
the below statement, my Session State works. How can I work this into my
web.config file? I've tried many combinations, but none worked. Or am I
looking in the wrong direction on how to fix this?

<pages enableSessionState="true" enableViewState="true"
enableViewStateMac="true" validateRequest="false" />

"Juan T. Llibre" wrote:

re:
!Not sure what you mean, but I do not have an InProc entry in my web.config file.
>
InProc is *also* the default.
>
If you want to disable SessionState *or* enable a different sessionState
management mode, other than InProc, you'll need to explicitly set those options.
>
Check to see if :
>
<section name="sessionState" type="System.Web.Configuration.SessionStateSection , System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
>
....is in your machine.config file...it should be there.
>
>
>
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaƱol : http://asp.net.do/foros/
======================================
"Wannabe" <Wa*****@discussions.microsoft.comwrote in message
news:FF**********************************@microsof t.com...
Not sure what you mean, but I do not have an InProc entry in my web.config
file.

"Peter Bromberg [C# MVP]" wrote:

InProc Session State is enabled by default in ASP.NET 2.0 You do not need any
entries at all in the Web.config.
>
--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com
>
>
>
"Wannabe" wrote:
>
I've been on this for a while, and cannot figure it out. Can someone please
help with this message?

SessionState 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><httpModulessection in the application
configuration.

Here is my current web.config file

<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="ReportServer" value="https://myserver/reportserver?/" />
</appSettings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authenticationsection enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows">
<forms loginUrl="Index.aspx"
cookieless="UseUri" />
</authentication>
<authorization>
<allow users="*" />
</authorization>
<!--
The <customErrorssection enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
<customErrors mode="Off">
</customErrors>
<trust level="Full" originUrl="" />

<httpModules>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</httpModules>

<!-- Enable session state for all the pages in the Web application. -->
<pages>
<controls>

<add tagPrefix="ajaxToolkit" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"
tagPrefix="ajaxToolkit"/>
</controls>
</pages>

</system.web>
</configuration>

>
>
>
>
>
>
Nov 16 '07 #11

This discussion thread is closed

Replies have been disabled for this discussion.