Cannot get session in webmethod in asp.net
<p>I just find that the problem is not related to the webmethod.</p>

<p>It is caused by another problem.</p>

<p>============================================================================
I set the Session["PhotoId"] in a normal aspx.
But I can't retrieve value in the webmethod of the aspx page.</p>

<pre><code>[WebMethod(EnableSession=true)]
    public static string Submit(string data1, ...)
    {
        string test = HttpContext.Current.Session["PhotoId"]; // test is null
    }
</code></pre>

<p>What should I do?</p>
