Skip to content

Instantly share code, notes, and snippets.

@szul
Created June 29, 2015 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save szul/feef8d4cd52c133ba6a0 to your computer and use it in GitHub Desktop.
Save szul/feef8d4cd52c133ba6a0 to your computer and use it in GitHub Desktop.
HttpContext to HttpContextBase and vice versa
//HttpContextBase to HttpContext (assumes HttpContextBase variable named contextBase)
HttpContext context = contextBase.ApplicationInstance.Context;
//HttpContext to HttpContextBase (assumes HttpContext variable named context)
HttpContextBase contextBase = new System.Web.HttpContextWrapper(context);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment