Hi ruben00000,
Add single quote while calling the function.
<a class="text-blue" href="javascript:void(0);" onclick="ShowItemWellCore(@i.REPORT_FILE_PATH);"><i class="fa fa-eye" aria-hidden="true"></i></a>
Refer below example.
Using this article i have created the example.
Loop through Model properties in View in ASP.Net MVC
Controller
public class HomeController : Controller
{
// GET: Home
public ActionResult Index()
{
NorthwindEntities entities = new NorthwindEntities();
return View(from customer in entities.Customers.Take(5)
select customer);
}
}
View
@model IEnumerable<Entity_Framework_MVC.Customer>
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
</head>
<body>
<h4>Customers</h4>
<hr />
<table cellpadding="0" cellspacing="0">
<tr>
<th>Customer Id</th>
<th>ContactName</th>
<th></th>
</tr>
@foreach (Customer customer in Model)
{
<tr>
<td>@customer.CustomerID</td>
<td>@customer.ContactName</td>
<td>
<a class="text-blue" href="javascript:void(0);"
onclick="ShowName('@customer.ContactName');">
<i class="fa fa-eye" aria-hidden="true"></i>
</a>
</td>
</tr>
}
</table>
<script type="text/javascript">
function ShowName(name) {
alert(name);
}
</script>
</body>
</html>
Screenshot