I'm working on .NET 4.7.2 When I define the path with a string, it doesn't work, but defines it in the tag it's working.
@{
ViewBag.Title = "Home Page";
}
@{
string path = Server.MapPath("~/Content/img/logo.jpg");
}
<img src="@path" alt="Alternate Text" />
<img src="~/Content/img/410.jpg" />