-1

I have View where I need to get src value for pic from db.

Here is View code

   <tbody id="findings" style="overflow-y: scroll;">
                @foreach (var item in Model)
                {
                    <tr>
                        <td class="point">
                            @(rowNo += 1)
                        </td>
                        <td style="display:none" id="patientId" class="title">
                            @Html.DisplayFor(modelItem => item.Patient_id)
                        </td>

                        <td class="title">
                            @Html.DisplayFor(modelItem => item.Patient.Date_of_Birthday)
                        </td>
                        <td id="nameVal" class="title">
                            @Html.DisplayFor(modelItem => item.Patient.Name)
                        </td>
                        <td class="title">
                            @Html.DisplayFor(modelItem => item.Start_appointment)
                        </td>
                        <td class="title">
                            <img src="@item.Calculation.CalculationStatus" />
                        </td>
                        <td class="title"></td>
                        <td class="title"></td>
                    </tr>
                 }
            </tbody>

But when I run I have error

Failed to load resource: the server responded with a status of 404 (Not Found)

In page source I have this <td class="title"> <img src="~/images/status_icons/openedCalculation.png" /> </td>

I don't understand why page not showing.

1 Answers1

0

Problem was at ~ symbol. Without it, all will be working.

  • 1
    yes, but if you just remove that `~` it will work only if `images` is at root server level. In other words, if you deploy this at a server like http://mywebsite.com/myapplication, since images is a folder of myapplication, it's not going to find it. – derloopkat Dec 08 '17 at 14:08