This logic should be handled inside your Controller and not the View. For example if you are trying to view a Product with MyID that does not exist then redirect to an error page.
If an error has occured you could also redirect to an InvalidProduct view that would provide a more detailed error description/instructions.
Edit: In addition to peoples comments below to catch unhandled exceptions add the [HandleError] attribute either on your ActionResult method declaration or on the Controller (for all ActionResults).
[HandleError]
public ProductsController
{
public ActionResult Show(int id)
{
Product p = //e.g. get product from db
if (p == null)
{
return RedirectToAction("Error");
//return RedirectToAction("InvalidProduct");
}
return View(p);
}