I am trying to save value in session in webservice but it gives me error: object reference not set to an instance of an object
.
Session["ProcessStartTime"] = strDate;
I am trying to save value in session in webservice but it gives me error: object reference not set to an instance of an object
.
Session["ProcessStartTime"] = strDate;
strDate
不为空Session["ProcessStartTime"] = strDate;
检查您使用之前声明方法启用了会话这是一个样本
public class mytest: System.Web.Services.WebService
{
[WebMethod (EnableSession = true)]
public string HelloWorld()
{
//your logic here
if(strDate!=null)
Session["ProcessStartTime"] = strDate;
else
// handle if ur strDate is null
}
}