In my mvc application, I'm trying to serve an html page like this
return File(Server.MapPath("~/Documentation/" + decoded["version"].ToString().Trim() + "/" + "index.htm"), "text/html");
The entry point index.htm includes some js scripts.
<script type="text/javascript" src="./whver.js"></script>
Even though I specified the relative url, the path of the included script is getting resolved to the application root.
Specifying an absolute path works, but I need scripts to reference a relative location because of a dynamically generated directory name.
I understand I provided not enough information. I think what is happening is that the .htm file is returned from the Index controller and its route is the application root. Thats why relative paths are resolved like that.