C#C
C#6mo ago
morry329#

Cannot Resolve Method

I am trying to display IformFile property as image on my cshtml

However I am getting somewhat errors here

<div class="wrapper" id="preExistingDashboard">
    @foreach (var listingModel in Model)
    {

        <div class="listing">


            <div class="content">
                <div>
                /* The ERROR here : Cannot resolve method: GetFileName(ListingProjects_ver2) Candidates are: GetFileName(ReadOnlySpan&lt;char&gt;) : ReadOnlySpan&lt;char&gt;<br/>GetFileName(string?) : string?<br/>all from class Path*/
                    <img src="@listingModel" alt="@System.IO.Path.GetFileName(listingModel)" style="display:block; width:100px;height:100px;">
                   
                </div>
                <p>
                    Property Name: <span class="view-mode listing-name">@listingModel.ListingName</span>
                    Property Review: <span>@listingModel.ListingReview</span>
                </p>
                
                <p>I am the pre-existing dashboard</p>
                <p>Age: @listingModel.Id</p>
                <div class="roundPlaceholder">
                    <p class="roundPlaceholderTxt">Book me before you edit</p>
                </div>
                <div class="deleteListingBtn">
                    <button type="button" class="delete" id="Delete" onclick="Delete(@listingModel.Id)" class="btn btn-danger">Delete</button>
                </div>
                //more code lines..
            </div>
        </div>

    }
`

Could anyone kindly point me out what went wrong here?? My full code for your reference https://paste.mod.gg/rjxcbrftbfyc/0
A tool for sharing your source code with the world!
Was this page helpful?