I need to invoke a function in the code behind from JavaScript
Button :
<button class = "btn btn-outline btn-danger dim" type = "button" onclick = "confirmDelete ()"> <i class = "fa fa-trash"> </i> Delete </button>
Javascript function :
<script>
function confirmDelete () {
if (confirm ('Are you sure you want to delete this?')) {
// call function Delete_Click ();
}
return false; // always cancel the click event
}
</script>
The function I am trying to call:
protected void Delete_Click (object sender, EventArgs e)
{
try
{
Delete item
}
catch (Exception ex)
{
SetError (ex.Message);
}
}
If I use <asp: Button> or <asp: LinkButton>, some CSS styles are not being displayed. That's why I am using