hello friends,
if any record is deleted and control return to the view i want to show message "record deleted"
how can i implement this.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Bhavik SolankiPosted Nov 22, 2011, 11:32 PM
You need to fill message in view data,viewbag or in tempdata and required to display in your view
here i have explain ajax save from button click i hope it will help you
http://bhaviksoluckydotnet.blogspot.com/2011/11/ajax-save-in-mvc-30-using-jquery.html
Regards
bhavik solucky
Christofel HakimPosted May 23, 2010, 9:17 AM
1. using a transition page,
so, when user press 'Delete' button, it will redirect to the transition page which give information to the user that the deletion was done successful.
this approash can be like this in your controller:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Delete(int id)
{
//do your delete logic here
return RedirectToAction("DeleteTransition");
}
public ActionResult DeleteTransition()
{
ViewData["Information"] = "The Record has been Deleted";
return View();
}
2. Using a javascript.
add an atributte to your button delete, so when user click the button delete, it will return an alert('record has been deleted').