0
HttpContext를 사용하여 세션 변수를 가져오고 설정하려는 메서드에 대한 비동기 호출을 만들고 있습니다. 하지만 HttpContext는 usign을 사용하는 동안 null을 표시합니다. 어떻게 HttpContext를 사용할 수 있습니까?비동기 호출에 HttpContext를 사용하는 방법
코드 :
public void SessionsFetchAllWatchNowAsync()
{
string aaa = Convert.ToString(HttpContext.Current.Session["UserID"]);
}
protected void Page_Load(object sender, EventArgs e)
{
Session[Utility.UserID] = 0;
Action<StartPage> notifyTask = null;
notifyTask = new Action<StartPage>((o) => new StartPage().SessionsFetchAllWatchNowAsync());
if (notifyTask != null)
notifyTask.BeginInvoke(null, null, null);
}
감사합니다,
Dalvir