Look at your code:
public ActionResult disp(studentmodel model, string command)
{
try
{
if (command == "Create")
{
return View("shows", model);
}
else if (command == "cancel")
{
return RedirectToAction("Index", "person");
}
}
catch(Exception e)
{
return View("Index");
}
}
What value is returned if
command
is not "Create" or "cancel"?
Your code doesn't specify, so VS rightly says that there is a way through the method that does not return any value - and you can't do that!