none
Exeption Session - O que pode ser?

    Pergunta

  • Bom Dia!

    Galera quando tento trabalhar com a Session acontece Exeption.

    Me._ctr_plano.popula_FOR_CHOISE()

    Session("gridView1") = Me.GridView1.DataSource

    Me.GridView1.DataBind()

    Obs.: a propriedade
    Enable View State do componete GridView1 está setado como TRUE.

    Obrigado

    ===============================


    Server Error in '/WebSite3' Application.

    Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection. If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name.

    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: Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection. If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [HttpException (0x8007274d): Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same.  If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection.  If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name.]
    System.Web.SessionState.OutOfProcSessionStateStore.MakeRequest(StateProtocolVerb verb, String id, StateProtocolExclusive exclusiveAccess, Int32 extraFlags, Int32 timeout, Int32 lockCookie, Byte[] buf, Int32 cb, Int32 networkTimeout, SessionNDMakeRequestResults& results) +1509
    System.Web.SessionState.OutOfProcSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem) +231
    System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +713
    System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +167
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +117


    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210






    domingo, 3 de dezembro de 2006 12:35

Respostas

  • Funcionou com ViewState

            If ViewState.Count = 0 Then
              
               Me._ctr_plano.popula_FOR_CHOISE()

               ViewState("GridView1") = Me.GridView1.DataSource

            Else


                Me.GridView1.DataSource = ViewState("GridView1")


            End If


            Me.GridView1.DataBind()




    domingo, 3 de dezembro de 2006 19:47