I have my registration, which was done using Scallfold's visual studio In my view:
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-actions no-color">
<input type="submit" value="Delete" class="btn btn-danger" /> |
</div>
}
And in my controller:
public ActionResult DeleteConfirmed(string id)
{
Cliente cliente = db.Clientes.Find(id);
db.Clientes.Remove(cliente);
db.SaveChanges();
return RedirectToAction("Index");
}
How do I validate the deletion if registration already exists with this client? How to return to View using html helper?