I would like to show an alert when user click the delete button as follows:
@Html.ActionLink("Delete", "Delete", new { id = Model.ID }, new { @data_role = "button" })
I’m not sure how I can get the id and event of onclick from this button.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could give an id to this anchor:
and then use jQuery to subscribe to the
clickevent:and if you are not using jQuery but plain javascript:
The
.confirm()javascript function displays the messages and returns true or false based on whether the user clicked on the OK or Cancel button.