Hi SajidHussa,
Check with below code.
<a href="@Url.Content("~/pdffiles/" + model.pdfnotes)">Show</a>
Check this example. Now please take its reference and correct your code.
Model
public class CustomerModel
{
public int Id { get; set; }
public string Name { get; set; }
public string Country { get; set; }
}
Controller
public class HomeController : Controller
{
// GET: Home
public ActionResult Index()
{
List<CustomerModel> model = new List<CustomerModel>();
model.Add(new CustomerModel { Id = 1, Name = "John Hammond", Country = "United States" });
model.Add(new CustomerModel { Id = 2, Name = "Mudassar Khan", Country = "India" });
model.Add(new CustomerModel { Id = 3, Name = "Suzanne Mathews", Country = "France" });
model.Add(new CustomerModel { Id = 4, Name = "Robert Schidner", Country = "Russia" });
return View(model);
}
public ActionResult Details(int id)
{
return RedirectToAction("Index");
}
}
View
@model IEnumerable<Url_Content_Model_MVC.Models.CustomerModel>
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
</head>
<body>
<table class="table">
<tr>
<th>@Html.DisplayNameFor(model => model.Name)</th>
<th>@Html.DisplayNameFor(model => model.Country)</th>
<th></th>
</tr>
@foreach (var model in Model)
{
<tr>
<td>@Html.DisplayFor(modelItem => model.Name)</td>
<td>@Html.DisplayFor(modelItem => model.Country)</td>
<td><a href="@Url.Content("/Home/Details/" + model.Id)">Show</a></td>
</tr>
}
</table>
</body>
</html>