WithEvents variable error message
When I try to run the following:
Private Sub ChangeBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChangeBtn.Click
Dim succ As Boolean = False
If (Page.IsValid) Then
Dim rs As Integer = UpdatePass(username.Text, userpass.Text)
If (rs > 0) Then
succ = True
End If
End If
If (succ) Then
frmchangepass.Visible = False
lblUserMessage.Text = "Your password has been changed to ..."
Else
lblUserMessage.Text = "Could not change password, please contact administrator"
End If
End Sub
I get an error message that highlights the first line of the sub and says:
"Handles clause requires a WithEvents variable."
I have to put the following code on the page and I don''t know exactly how or where:
Protected WithEvents frmchangepass As System.Web.UI.HtmlControls.HtmlForm
Thanks for any ideas.