[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 760
  • Last Modified:

session not available when using AJAX

hi,

i'm trying to call a session that i create on my first page let call it session("test1") this session contains an array lets call it ar1. I am trying to call my ajax function located on "AjaxFunctions.vb" call "ParseArray" everything goes well untill i try to get the info inside my session. all i get is "Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive", now session state is turned on, the page that contains the ajaxfunction also has the enablesessionstate="true" flag. What am i doing wrong.

Vince
0
VBSMerlin
Asked:
VBSMerlin
  • 2
1 Solution
 
williamcampbellCommented:
<web.config>
    <sessionState

Did you try setting it in Web.Config?
All are you using Sharepoint Services or FreeToolBox?
0
 
VBSMerlinAuthor Commented:
this is the linbe in my web config

<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
                  cookieless="false" timeout="60" />
0
 
VBSMerlinAuthor Commented:
Figured it out for anyone else that might ever get this problem here is the solution to AJAX and Session State

If you ever get in your AJAX function an error stating that the session is null. Add the following handler in front of your Function that will resolve the issue

<Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)> _
Public Function SomeFunction() As String
  'your code here
  Return aString
End function
0
 
GranModCommented:
PAQed with points refunded (500)

GranMod
Community Support Moderator
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now