ManicCW
Well-known member
Hi,
I need to add attribute to button in datagrid. I use this in datagrid ItemDataBound event:
Now this javascript function is located in external file. Here is function:
Now when confirm box is raised and I click Cancel postback occurs!?
Postback does not occur when I use javascript function in page itself like:
What is the problem here???
I need to add attribute to button in datagrid. I use this in datagrid ItemDataBound event:
VB.NET:
Dim imgDelete As ImageButton = CType(e.Item.Cells(6).FindControl("imgDelete"), ImageButton)
imgDelete.Attributes.Add("onClick", "ConfirmDelete()")
Now this javascript function is located in external file. Here is function:
VB.NET:
function ConfirmDelete(){
return confirm("Ovom akcijom trajno brisete zapis!\nOK za nastavak.\nCancel za ponistavanje akcije.");
}
Now when confirm box is raised and I click Cancel postback occurs!?
Postback does not occur when I use javascript function in page itself like:
VB.NET:
imgDelete.Attributes.Add("onClick", "return confirm('Ovom akcijom trajno brisete zapis!\nOK za nastavak.\nCancel za ponistavanje akcije.');")
What is the problem here???