Skip to content

Instantly share code, notes, and snippets.

@vgrem
Created November 25, 2014 13:18
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 vgrem/b5d646c899255e8e9216 to your computer and use it in GitHub Desktop.
Save vgrem/b5d646c899255e8e9216 to your computer and use it in GitHub Desktop.
if (HttpContext.Current == null)
{
HttpRequest request = new HttpRequest("", web.Url, "");
HttpContext.Current = new HttpContext(request, new HttpResponse(new StringWriter()));
HttpContext.Current.Items["HttpHandlerSPWeb"] = web;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment