WebServices and Session

Posted on 2011-10-14
Last Modified: 2012-05-12

Please forgive the dumb question, but if a WebService is written under the same namespace as a WebForm -- can the WebService pass the Session variable to a static class that does the work?

What's happening is I am calling a web service from client using jQuery ajax / JSON and passing a bunch of info.

The webservice webmethod then calls a method in a static class, said method needs to put some data into Session, but I guess it can't.  Session is not recognized.

Are there workarounds?
Question by:knowlton
    LVL 6

    Assisted Solution

    If I understand you correctly, your question is about an ASP.NET Web Service (provider). In order to understand your question more clearly, please attach .NET code sample of the Web Service.
    LVL 5

    Author Comment

    I think I may have figured it out.

    Give me a little while and I'll come back and report on what I found.
    LVL 7

    Accepted Solution

    have you set the attribute [WebMethod(EnableSession = true)] to the webmethod?
    LVL 5

    Author Closing Comment

    >>>>have you set the attribute [WebMethod(EnableSession = true)] to the webmethod?

    Nope, but when I did, it began working...thx!!!

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now