I need to use the same view, but have different data based on what button the user selects show up in the table. I would like to do this through just passing a parameter through the html.actionlink.
This is what i have currently in the View
<li id="liOpenJobs">@Html.ActionLink("All Jobs", "AllJobs", "AdminJobs", new { filter = "All" })</li>
Controller
[HttpGet]
public ActionResult AllJobs(string filter)
{
if (PCSSession.Current.IsAuthenticated)
{
var jobs = new JobRepository();
var model = new JobsHistoryViewModel();
if(filter == "All")
{
model.jobHistory = jobs.GetAllJobs("alljobs");
}
return View(model);
}
return RedirectToAction("AdminLogin", "AdminLogin");
}