Add another Controller Action Method, that would take exception as parameter.
From each link click action put the logic in try catch block and catch the exception and inside the catch :
try{
}
catch(Exception ex)
{
if(es.Message == "check for the message matching http:404")
{
return RedirectToAction("NotFound");
}
}
public ActionResult NotFound()
{
return View();
}
Hope this helps
Thanks
:)