You've tagged this question as C#, but only posted Javascript code.
Assuming you're using ASP.NET, and are trying to use an
app-relative path[
^], that only works in server-side code. For Javascript, you need to use either a relative path (
../path/to/file.ext
), a site-relative path (
/app/path/to/file.ext
) or an absolute path (
https://yoursite.tld/app/path/to/file.ext
).
You should update your server-side code to resolve the app-relative path and return that instead of simply returning the file name.