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.
ASP.NET MVC
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Christofel Hakim81 reputationPosted May 23, 2010, 5:17 AM EDT
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').
Bhavik Solanki31 reputationPosted Nov 22, 2011, 6:32 PM EST
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