I have the following code to store session variable in one webmethod and retrieve it in other webmethod but the value displays null when i try to retrieve it.
[WebMethod(EnableSession = true)] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public bool SubmitList1(string businessname ) {
Session["Company_Name"] = businessname;
SqlConnection con = new SqlConnection();
.......
.........
.........
}
This will be my second webmethod where i am trying to retrieve the session variable [WebMethod(EnableSession = true)] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public bool addresslisting() {
string companyname = (string)Session["Company_Name"];// this particular value is displaying null
......
........
}