I am developing a MVC4 application. I have an action in the controller.
It basicly takes the Id of item (here telephone number) and change the value of deleted column. So the user can not see the item and thinks that he/she deleted it. Whatever, here is the code.
public ActionResult VirtualDelete(int Id = 0)
{
var guncelle = _telefon.Select(Id);
guncelle.Deleted = 0;
_telefon.Update(guncelle);
return RedirectToAction("Profil", "Kisi", new { Id = guncelle.KisiID });
}
On the view side I have a button, that runs the action.
<a href="@Url.Action("VirtualDelete", "Telefon", new { Id = @telefon.TelefonID })" class="btn btn-danger">
</a>
The problem is that; When the user clicks on the delete button, A submission is required. Are you sure. Do you want to delete this item? If Ok, delete it, If not, dont delete... I think this is JS stuff. So I am blind of JS. Could anyone help me?
PS:I researched, however there is no solution with URL.Action.