VB Code:
'In code behind
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
btnSubmit.Attributes.Add("onclick", "return disableMe(this);")
End If
End Sub
Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSubmit.Click
'Fairly long process here
End Sub
'In Script in .aspx file
<script language="javascript">
function disableMe(btn) {
btn.disabled = true;
document.form1.submit();
return true;
}
</script>
I've found quite a few examples on the web but couldn't get any of them to work.