Click here to Skip to main content
15,922,696 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
C#
[WebMethod]
public static void AppOff()
{
  Session.Abandon();
}


It didn't work any suggestions?
Thank you :)
Posted

1 solution

Have a look at EnableSession as part of the WebMethod attribute

C#
// C#
public class Service1 : System.Web.Services.WebService
{
    [System.Web.Services.WebMethod(EnableSession=true)]
    public double ConvertTemperature(double dFahrenheit)
    {
       Session["Conversions"] = (int) Session["Conversions"] + 1;
       double temperature = ((dFahrenheit - 32) * 5) / 9;

       Session.Abandon();
       return temperature;
    }
}
 
Share this answer
 
Comments
Member 7966831 16-Jun-11 13:28pm    
Thanks for your solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900