When my button is clicked, it triggers the following code:
protected void Button6_Click(object sender, EventArgs e)
{
Page.ClientScript.RegisterStartupScript(this.GetType(),
"myScript", "AnotherFunction();", true);
}
In addition, I have a server-side function called Delete()
:
public void Delete()
{
//Delete Code
}
After the button click, control is passed to this javascript
function:
To achieve my goal of calling the Delete()
function on the SERVER side, here's what I've attempted so far in my javascript function:
function (isConfirm)
{
if (isConfirm)
{
//CALL DELETE FUNCTION HERE Delete();
swal("Deleted!", "Your imaginary file has been deleted.", "success");
}
else
{
swal("Cancelled", "Your imaginary file is safe :)", "error");
}
});
I'm seeking advice on how to successfully call that server-side function. Any suggestions?