Click here to Skip to main content
15,888,000 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Team

I have a folder called 'eNtsaImages' but somehow there are images inside and i am trying to access them on View side, they are not visible and when i inspect i get 404 load to failed resources. Let me share this logic with the team for support, thanks. Should i change the class name from the div a.photo?

What I have tried:

@model IEnumerable<eNtsaRegistrationTraining.Models.TrainingAcademy_Courses>

@{
    ViewBag.Title = "eNtsaList";
    Layout = "~/Views/Shared/_eNtsaPageLayout.cshtml";
}


<script src="~/Scripts/jquery-3.4.1.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<div class="form-group row">
    @foreach (var item in Model)
    {
        <div class="col-md-4">
            <div class="row">
                <h4><span id="coursename" style="color:aquamarine">@item.CourseDetails</span></h4>
                <p><span class="glyphicon glyphicon-heart" style="color:red;pointer-events:fill" contextmenu="Added to Wishlist"></span></p>
            </div>

            <a href="@Url.Action("EachCourseDetails", "Home", item)">
                <img class="a.photo" src="~/eNtsaImages/@item.Url" style="overflow:hidden;position:relative; width:200px; height:200px; cursor:pointer" />
            </a>

            <p><a class="btn btn-primary" href="">View More »</a></p><span class="glyphicon glyphicon-shopping-cart" style="color:green"></span>
        </div>



    }

</div>
Posted
Comments
Richard Deeming 25-Nov-20 8:28am    
That's going to depend on what @item.Url returns, how you've mapped the directory to your application, and what permissions you have on the files in that directory.

Start by trying to open one of the image URLs directly on the server. IIS should return a detailed error telling you why it can't be loaded.
gcogco10 25-Nov-20 9:02am    
Thanks man, lol i see what went wrong, on my table record i should have those images saved there, when im doing an insert into statement. data type for those are incorrect, yet thanks also when mentioning this to me clearly. Let me work on that, i will be able to get them without any issue.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900