static string GetCurrentPath (HttpContext ctx) { HttpRequest req = ctx != null ? ctx.Request : null; return req != null ? req.PathNoValidation : HttpRuntime.AppDomainAppVirtualPath; }