title: how to show the image in .net core
body: <p>I am working with .net core 3.1</p>
  <p>I am successfully upload the image in database but I am trying to display that image but not able to display</p>
  <p>when I am seeing the console error:</p>
  <p>This localhost page can’t be foundNo webpage was found for the web address:
  https://localhost:00000000/home/WebRootPath/Imagef/_b9f5Image.jpg</p>
  <p><a href="https://i.stack.imgur.com/YVphX.png" rel="nofollow noreferrer">Database Image</a></p>
  <p><a href="https://i.stack.imgur.com/cGkzg.png" rel="nofollow noreferrer">Index Page Image</a></p>
  <p><a href="https://i.stack.imgur.com/hRzLF.png" rel="nofollow noreferrer">Image Folder Path</a></p>
  <p>Student.cs</p>
  <pre><code>namespace TestCore.Models
  {
      public partial class Student
      {
          public string ImageDescription { set; get; }
          public string ImageName { set; get; }
      }
  
      public class StudentViewModel
      {
          public string ImageDescription { set; get; }
          public IFormFile File { set; get; }
      }
  }
  
  </code></pre>
  <p>HomeController.cs</p>
  <pre><code>        [HttpGet]
          public IActionResult Index()
          {
              return View(studDBContext.students.ToList());
          }
  
          [HttpGet]
          public IActionResult Create()
          {
              return View();
          }
          [HttpPost]
          public IActionResult Create(StudentViewModel svm)
          {
              if (svm.File != null)
              {
                  var fileName = Path.GetFileName(svm.File.FileName);
                  var createGUID = &quot;_&quot; + Guid.NewGuid().ToString().Substring(0, 4);
                  var filePath = Path.Combine(&quot;WebRootPath&quot;, &quot;Imagef&quot;, createGUID + fileName);
                                                                            
                  using (var fileSteam = new FileStream(filePath, FileMode.Create))
                  {
                      svm.File.CopyTo(fileSteam);
                  }
  
                  Student student = new Student();
                  student.ImageDescription = fileName;
                  student.ImageName = filePath ;
  
                  studDBContext.students.Add(student);
                  studDBContext.SaveChanges();
              }
              return View();
          }
  </code></pre>
  <p>Index.cshtml</p>
  <pre><code>&lt;tbody&gt;
          @foreach (var item in Model)
          {
              &lt;tr&gt;
                  &lt;td&gt;
                      @item.ImageDescription
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;img src=&quot;@Url.Content(item.ImageName)&quot; alt=&quot;Image&quot; style=&quot;width:50px;height:50px;&quot; /&gt;
                  &lt;/td&gt;
  </code></pre>
  <p>I want to show image in index page need help</p>
  <p>I think logic is I think Image need the whole path but I am not given whole path that is issue I think</p>
  <p>I am trying but image not shown</p>