1: HttpContext ctx = HttpContext.Current;
2: HttpContext.Current = null;
3:
4: try
5: {
6: // TODO:your code
7: }
8: finally
9: {
10: HttpContext.Current = ctx;
11: }
This has always worked for me although recently I spied another approach on Kristian Kjær blog which also works well; the choice is yours.
No comments:
Post a Comment