I am trying to go from https://localhost:44383/Reservations/Index
to https://localhost:44383/Bikes/Details/{Id}
But I don't know what html actionlink
i need.
I thought this was the right one: @Html.ActionLink("Details", "Details", "Bikes", new { Id = item.Reservation.Bike_Id })
Can someone tell me how to go from Reservation controller to details controller and give details and id as parameter?
@Html.ActionLink("Details", "Details" , "Bikes")
brings me to localhost/Bikes/Details
. But I need the id at the back as well
public ActionResult Details(int? id)
{
if (id == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
Bike bike = db.Bikes.Find(id);
if (bike == null)
{
return HttpNotFound();
}
return View(bike);
}