I am trying to display information of a certain product depending on the URL with the ID being requested. (for example, if the URL is http://localhost:xxxxx/products/productlist?Id=1) display the view of the product ID.
How can I get the ID from the URL to do an IF statement and display the productID?
@{string value = Request.QueryString["Id"]}
@foreach (var product in Model.prodcuts)
{
if (product.products == value)
{
<tr>
<td>@(product.Name)</td>
</tr>
}
}