In Details
, Edit
, Delete
action methods we have id
parameter to retrieve the corresponding record from the database.
If no record corresponds to the id
, we have 2 choices:
The executing action method returns a specific view, which is usually named as
NoFound.cshtml
underViews\Shared
directory, to inform the user that theid
is not valid.
or
The executing action method redirect the user to a specific action method, for example
public ActionResult NoFound (string message)
, to inform the user about the issue.
My question is:
When no record associated with the given id, which action should the action method do? Returning NoFound
view or redirecting to NoFound
action method?
Edit 1 I need reasons from technical point of view such as security and performance.