passing data between web forms

I get the following message when the second form is called

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.

enableSessionState is set to true in both form1 and form2

I have the following code in my Web.config

<modules runAllManagedModulesForAllRequests="true" >
<remove name="Session" />
<add name="Session" type="System.Web.SessionState.SessionStateModule" />

And the following code in the second form

class-id SalarySurveyWebApplication.WebFormCSE110 is partial
inherits type System.Web.UI.Page public implements type

* $ilusing "System.Web"
* $ilusing "System"
working-storage section.

method-id NEW.
procedure division.

if (Session["TESTVAR"] not = null)
set txtComp::Text to Session["TESTVAR"]

The error occurs on the red line

Parents Reply Children