I need to display different cat breed info in a single view whenever the respective link is clicked.
When I click on “Find out more!”, I should be retrieving info about that particular cat from DB.
Here is how my controller looks like:
{
using (catbreedEntities db = new catbreedEntities())
{
var model = db.cats_front_page.Find(1);
return View(model);
}
}
And here is how the view looks like:
@model royalcatbreed.Models.cats_front_page
@{
ViewBag.Title = "BreedView";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h4 class="card-title">@Model.cat_name</h4>
I understand that with this I will only be able to retrieve the name of the first cat from DB each time I click on “Find out more!”. But how can I retrieve data for each particular cat?
Many thanks in advance.