As I see it, everything should be fine.
Since HttpContext.Current.Session is not null, session state is maintained here. Make sure you set Session ["PhotoId"].
You can check if this is the same session by exploring
HttpContext.Current.Session.SessionID
in both regular ASPX and WebMethod.
Alexander Yezutov
source share