enablesessionstate Page directive is needed to use the Session object

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default enablesessionstate Page directive is needed to use the Session object


    Hello,

    on IIS6 running on Win2003 server std. I get this error

    "enablesessionstate Page directive is needed to use the Session object"



    my web.config looks like this:

    <sessionState
    mode="InProc"
    stateConnectionString="tcpip=127.0.0.1:42424"
    sqlConnectionString="data source=127.0.0.1;user id=sa;password="
    cookieless="false"
    timeout="20"
    />
    <pages validateRequest="false" enableSessionState="true"/>


    my machine.config like this:

    <pages buffer="true" enableSessionState="true"
    enableViewState="true"
    enableViewStateMac="true" autoEventWireup="true"
    validateRequest="true" />
    <sessionState
    mode="InProc"
    stateConnectionString="tcpip=127.0.0.1:42424"
    stateNetworkTimeout="10"
    sqlConnectionString="data source=127.0.0.1;Integrated
    Security=SSPI"
    cookieless="false"
    timeout="20"
    />


    The defaults should be ok ?

    If I Set
    enableSessionState="true"
    at page level, it works, but we have 1200 Pages so my goal is to use
    the default settings from web.config. Where else can I look ?


    Thanks,

    Marco



    Marco Gerlach Guest

  2. Similar Questions and Discussions

    1. adodb.recordset object and the IIS session object
      I was looking through the registry of a Windows 2000 Adv. Server I just built and noticed that the adodb.recordset object had been set to "both"...
    2. HELP! - "The WSIntranet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=24410d33c1a2222e assembly specified in a Register directive of this page could not be found"
      Hi, I am just building my first webpart. It worked fine when I just had output.write("hello"). As soon as I try and do this: SPWeb...
    3. Adding a Register directive to an aspx page programmatically
      Hi ! I am reposting the following question as it went under another topic (don't know exactly why) I have a design-time problem that puzzle...
    4. Global.asa and EnableSessionState
      Hello Everyone, I was wondering if the following line at the top of my global.asa file is legal: <SCRIPT @ENABLESESSIONSTATE = FALSE LANGUAGE...
    5. Can't use Session in ASP.NET - enableSessionState error
      Cristian, If you add an appkey to the web.config, are you able to retrieve it? I'm just wondering if the web.config is getting parsed. Jim...
  3. #2

    Default enablesessionstate Page directive is needed to use the Session object

    Hi Marco

    Try the following way:

    <configuration>
    <system.web>
    <pages buffer="true"
    enableSessionState="true"/>
    </system.web>
    </configuration>


    HTH
    Ravikanth
    >-----Original Message-----
    >
    >Hello,
    >
    >on IIS6 running on Win2003 server std. I get this error
    >
    >"enablesessionstate Page directive is needed to use the
    Session object"
    >
    >
    >
    >my web.config looks like this:
    >
    > <sessionState
    > mode="InProc"
    > stateConnectionString="tcpip=127.0.0.1:42424"
    > sqlConnectionString="data
    source=127.0.0.1;user id=sa;password="
    > cookieless="false"
    > timeout="20"
    > />
    ><pages validateRequest="false"
    enableSessionState="true"/>
    >
    >
    >my machine.config like this:
    >
    > <pages buffer="true" enableSessionState="true"
    >enableViewState="true"
    > enableViewStateMac="true"
    autoEventWireup="true"
    >validateRequest="true" />
    > <sessionState
    > mode="InProc"
    > stateConnectionString="tcpip=127.0.0.1:42424"
    > stateNetworkTimeout="10"
    > sqlConnectionString="data
    source=127.0.0.1;Integrated
    >Security=SSPI"
    > cookieless="false"
    > timeout="20"
    > />
    >
    >
    >The defaults should be ok ?
    >
    >If I Set
    >enableSessionState="true"
    >at page level, it works, but we have 1200 Pages so my
    goal is to use
    >the default settings from web.config. Where else can I
    look ?
    >
    >
    >Thanks,
    >
    >Marco
    >
    >
    >
    >.
    >
    Ravikanth[MVP] Guest

  4. #3

    Default Re: enablesessionstate Page directive is needed to use the Session object


    Hi Ravikanth,

    in my settings enableSessionState in machine.config and web.config was set
    to "true".

    I added "buffer"=true but i didn't help.

    Do you know other settings ?

    Thanks,

    Marco


    "Ravikanth[MVP]" <dvravikanth@hotmail.com> schrieb im Newsbeitrag
    news:09ab01c34d15$10faf500$a501280a@phx.gbl...
    > Hi Marco
    >
    > Try the following way:
    >
    > <configuration>
    > <system.web>
    > <pages buffer="true"
    > enableSessionState="true"/>
    > </system.web>
    > </configuration>
    >
    >
    > HTH
    > Ravikanth
    >
    > >-----Original Message-----
    > >
    > >Hello,
    > >
    > >on IIS6 running on Win2003 server std. I get this error
    > >
    > >"enablesessionstate Page directive is needed to use the
    > Session object"
    > >
    > >
    > >
    > >my web.config looks like this:
    > >
    > > <sessionState
    > > mode="InProc"
    > > stateConnectionString="tcpip=127.0.0.1:42424"
    > > sqlConnectionString="data
    > source=127.0.0.1;user id=sa;password="
    > > cookieless="false"
    > > timeout="20"
    > > />
    > ><pages validateRequest="false"
    > enableSessionState="true"/>
    > >
    > >
    > >my machine.config like this:
    > >
    > > <pages buffer="true" enableSessionState="true"
    > >enableViewState="true"
    > > enableViewStateMac="true"
    > autoEventWireup="true"
    > >validateRequest="true" />
    > > <sessionState
    > > mode="InProc"
    > > stateConnectionString="tcpip=127.0.0.1:42424"
    > > stateNetworkTimeout="10"
    > > sqlConnectionString="data
    > source=127.0.0.1;Integrated
    > >Security=SSPI"
    > > cookieless="false"
    > > timeout="20"
    > > />
    > >
    > >
    > >The defaults should be ok ?
    > >
    > >If I Set
    > >enableSessionState="true"
    > >at page level, it works, but we have 1200 Pages so my
    > goal is to use
    > >the default settings from web.config. Where else can I
    > look ?
    > >
    > >
    > >Thanks,
    > >
    > >Marco
    > >
    > >
    > >
    > >.
    > >

    Marco Gerlach Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139