Load image from a folder using URL from database in MVC
<p>In an <code>ASP.NET MVC</code> application, <code>file</code> is successfully saved to a folder and its <code>URL</code> is saved to <code>SQL database</code>. <code>URL</code> is saved in an <code>Absolute URL</code> form i.e., (D:\Visual Studio Projects\HRMS\HRMS\App_Data\photos\5.png). Having problem in loading <code>file</code> in a browser from folder using this <code>URL</code>. Code implementation is: </p>

<pre><code>[HttpPost]
[ActionName("UploadPhoto")]
public ActionResult UploadPhoto(HttpPostedFileBase photoPath)
{
    var fileName = Path.GetFileName(photoPath.FileName);
    if (photoPath.ContentLength &gt; 0)
    {
        var path = Path.Combine(Server.MapPath("~/App_Data/photos"), fileName);
        photoPath.SaveAs(path);
    }
    ViewBag.upload = "Success! Photo was uploaded successfully.";
    string fpath = Path.Combine(Server.MapPath("~/App_Data/photos"), fileName);
    TempData["filePath"] = fpath;
    return RedirectToAction("CreateWithImage", new { path = fpath });
}

public ActionResult CreateWithImage(string path)
{
    employee em = new employee();
    em.districts = new SelectList(hc.districts, "name", "name");
    string fp = Convert.ToString(TempData["filePath"]);
    em.photoPath = fp;
    return View(em);
}
</code></pre>

<p>file (image) is rendered in a view as: </p>

<pre><code>@model HRMS.Models.employee
&lt;dd&gt;
    &lt;img src="@Url.Content(@Model.photoPath)" /&gt;
&lt;/dd&gt;
</code></pre>

<p>When View is called, I see a broken link for the image. HTML(with correct file path) for the loaded page (View) is seen as: </p>

<pre><code>&lt;dd&gt;                
    &lt;img src="D:\Visual Studio Projects\HRMS\HRMS\App_Data\photos\5.png" /&gt;
&lt;/dd&gt;
</code></pre>

<p>Can someone note the problem and guide accordingly?</p>