this is my code
ProductController.cs
public ActionResult Details(string id)
{
product productx = productDB.products.Single(pr => pr.Product1 == id);
return View(productx);
}
Details.aspx
<td>
<%-- : Html.ActionLink("Edit", "Edit", new { id=item.Id }) % -->
<%: Html.ActionLink("Details", "Details", new { id = item.Product1 })%>
</td>
this is what im uses to list some products from sql database, each product has a link to the details page to show more information about it
what I'm trying is only to put the product label in this link so that it displays something like www.mysite.com \ products \ battery (and not id)
I assumed that this should work, but it throws text data types and nvarchar are incompatible with the equal operator. error and neither (pr => pr.Product1.Equals(id));works
the error is clear, and I ask how can I make it work that way?
thank