나는이 문제가 webmethod와 관련이 없음을 발견했습니다.asp.net의 webmethod에서 세션을 가져올 수 없습니다.
다른 문제가 원인입니다.
Session["PhotoId"]
을 정상 aspx로 설정했습니다. 그러나 aspx 페이지의 webMethod
에서 값을 검색 할 수 없습니다.
[WebMethod(EnableSession=true)]
public static string Submit(string data1, ...)
{
string test = HttpContext.Current.Session["PhotoId"]; // test is null
}
어떻게해야합니까?
sessionid가 동일한 지 확인하십시오. – Aravind