I have button that when clicked, submits records into the database. What im wanting to do is AFTER that button is click it fire a javaScript function. The problem i having is that its always firing before the records are getting inserted. Im new to this clientScript and registering it so please forgive my ignoreance on the subject. I have tried RegisterClientScriptBlock, RegisterStartupScript, and RegisterOnSubmitStatement and not getting the desired result. My code is below. Any help would be very much appreciated.
' on load
If (Not ClientScript.IsClientScriptBlockRegistered("alert")) Then
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "alert",
"alertHello()", True)
End If
'button clicked
Button1.Attributes.Add("onclick", " return alertHello();")