我剛發現問題與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 2011-03-17 15:24:34