1

Here's the scenario. My page loads with certain objects in the session. The user clicks a button, and I need to update a certain section of my page using jquery. The jquery would make an ajax call to the web service which needs to access one of the objects in the session. How would I do this? How can my web service access the current session object?

update: I'm using asmx

cbp
  • 25,252
  • 29
  • 125
  • 205
Riz
  • 6,486
  • 19
  • 66
  • 106

2 Answers2

2

all you do is set (EnableSession = true) on your webmethod attribute.

Riz
  • 6,486
  • 19
  • 66
  • 106
0

If your building a WCF service you can set this attribute on the class:

[AspNetCompatibilityRequirements
    (RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]

Which should give you access. If your using asmx I don't remeber off the top of my head

JoshBerke
  • 66,142
  • 25
  • 126
  • 164