Improve your Edit controlling so that it handles the exceptions that are thrown and redisplays the input the user has typed in so far. I'm sure you were about to ;)
Update your view to have validators:
<label for="Name">Name:</label>
<%= Html.TextBox("Name", Model.Name) %>
<%= Html.ValidationMessage("Name", "*") %>
and then utilize them in your editing:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Edit(Person Model)
{
try
{
ctx.AttachUpdated(Model); //extension
ctx.SaveChanges();
return RedirectToAction("Index");
}
catch
{
foreach (var err in Model.Errors)
ModelState.AddModelError(err.PropertyName, err.ErrorMessage)
return View(Model);
}
}