© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•8mo ago•
2 replies
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>

    }
<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
BlazeBin - rjxcbrftbfyc
A tool for sharing your source code with the world!
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ cannot resolve AddDatabaseDeveloperPageExceptionFilter();
C#CC# / help
3y ago
Cannot resolve AddAuthentication()
C#CC# / help
3y ago
Cannot resolve symbol 'HttpPostedFileBase'
C#CC# / help
10mo ago
Cannot resolve symbol 'ServiceController'
C#CC# / help
2y ago