2017年7月2日 星期日

HttpContext <=> HttpContextBase



Getting HttpContext from HttpContextBase’s instance:

HttpContext httpContext = httpContextBase.ApplicationInstance.Context;


To get HttpContextBase from HttpContext we have to wrap it in HttpContextWrapper:


HttpContextBase abstractContext = new System.Web.HttpContextWrapper(context);

沒有留言:

張貼留言