locked
API Method to Return "../images/xyz.png" is returning "/api/images/xyz.png" RRS feed

  • Question

  • User1809093284 posted

    Hi

    I have a service method with some hardcoded "C#" - this service API is part of the main Asp.Net MVC Core web application (not a separate project).

    Error message: http://localhost:5000/api/images/blockdevice.png 404 (not found).

    //READ - TREE NODES FOR {SYSTEM - TABLE - LOOKUP SETUP etc.}
    [HttpPost]
    public async Task<IActionResult> ReadSystemTree([FromBody]object route)
    {
    
    .....
    icon = "../images/blockdevice.png", 
    ....
    
    }
    
    

    Tuesday, August 13, 2019 6:09 AM

Answers

  • User1809093284 posted

    Got the answer ...

    Instead of specifying "../images/xxx.png" in the sample above - i have to simply specify "/images/xxx.png" without adding two dots or the tilde ~ character ...

    now it works.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 13, 2019 6:25 AM