Confirm delete of record, from method
- by Melt
Hi all,
How can I pop up a message box to confirm a delete, from inside a method?
Normally i would just use the following line in my button:
OnClientClick="return confirm('Are you sure you want to delete this comment?');"
However this delete method can also be called by a querystring, so I need the confirm message box functionality in the method, please?
// delete comment method
private void DeleteComment()
{
int commentid = Int32.Parse(Request.QueryString["c"]);
// call our delete method
DB.DeleteComment(commentid);
}
I can't click the button through code, because it doesn't fire the OnClientClick event
btnDelete_Click(null, null);
Regards
Melt