0

I have a AFile.html inside an HttpModule. This file is being used to keep my actual code cleaner / more concise

Inside the HttpModule, in a file on the same structure level as the html file, I have

Response.WriteFile("AFile.html"); 

Expected result would be that it would find AFile.html because it's structurally right next to the file that calling it. Instead I'm getting the following error.

"Cannot find file C:\Path\To\Website\AFile.html".

Is it possible for an HttpModule to access a file within the module itself? Or does the file have to be included in the appropriate spot in every application the httpmodule is included in? If the latter, doesn't that completely defeat the purpose of an httpmodule?

Bardicer
  • 1,405
  • 4
  • 26
  • 43
  • Is the HTML file embedded as a resource? –  Nov 11 '13 at 19:35
  • It is not. It is just a html file inside the project (on the same level as the code files). – Bardicer Nov 13 '13 at 20:35
  • Is `C:\Path\To\Website\AFile.html` the correct path, and does that file actually exist? What happens if you do this instead: `Response.WriteFile("~/AFile.html")`? – Joshua Frank Jun 18 '14 at 18:25

0 Answers0