i want to call the function located 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; // cancel the click event always
}
</script>
the function I want 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>, there are some css don't show up. That's why I use