Retrieving session values from webservices using c#

In this session I'm going to teach about webservices in Asp.net .Webservices are used for retrieving values from database with the help of List,array and so on.

Here we are gonna see how to retrieve session values.

[WebMethod(Enable Session=true)]
Public void Showme()
{

string a =string.Empty;
if(HttpContext.Current.Session["name"].ToString() !=null)
{
a=HttpContext.Current.Session["name"].ToString() ;
}

}

Now the variable "a" holds the session value "name".

Comments

Popular posts from this blog

Types of Architects

Basic measurements

Search html table contents based on its td using Jquery