S
shapper
Hello,
I have a custom control where I have a button.
I need to raise the event FormSubmited after all the code, in
Button_Click, is finished.
The problem is when I check FormSubmited in my page nothing happens:
Private Sub Form_FormSubmited(ByVal sender As Object, ByVal e As
EventArgs) Handles Form.FormSubmited
Response.Write("For Was Submited")
End Sub
My custom control code is as follows:
...
Public Class Contact
Inherits WebControl
Private Sub bSubmit_Init(ByVal sender As Object, ByVal e As
System.EventArgs)
.....
End Sub
Private Sub bSubmit_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
' SOME CODE
' Raise the OnFormSubmited event
RaiseEvent FormSubmited(Me, EventArgs.Empty)
End Sub
Public Event FormSubmited As EventHandler
Protected Overridable Sub OnFormSubmited(ByVal e As EventArgs)
RaiseEvent FormSubmited(Me, e)
End Sub
Protected Overrides Sub CreateChildControls()
AddHandler bSubmit.Init, AddressOf bSubmit_Init
AddHandler bSubmit.Click, AddressOf bSubmit_Click
MyBase.Controls.Add(bSubmit)
End Sub
End Class
Could someone tell me what am I doing wrong here?
Thanks,
Miguel
I have a custom control where I have a button.
I need to raise the event FormSubmited after all the code, in
Button_Click, is finished.
The problem is when I check FormSubmited in my page nothing happens:
Private Sub Form_FormSubmited(ByVal sender As Object, ByVal e As
EventArgs) Handles Form.FormSubmited
Response.Write("For Was Submited")
End Sub
My custom control code is as follows:
...
Public Class Contact
Inherits WebControl
Private Sub bSubmit_Init(ByVal sender As Object, ByVal e As
System.EventArgs)
.....
End Sub
Private Sub bSubmit_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
' SOME CODE
' Raise the OnFormSubmited event
RaiseEvent FormSubmited(Me, EventArgs.Empty)
End Sub
Public Event FormSubmited As EventHandler
Protected Overridable Sub OnFormSubmited(ByVal e As EventArgs)
RaiseEvent FormSubmited(Me, e)
End Sub
Protected Overrides Sub CreateChildControls()
AddHandler bSubmit.Init, AddressOf bSubmit_Init
AddHandler bSubmit.Click, AddressOf bSubmit_Click
MyBase.Controls.Add(bSubmit)
End Sub
End Class
Could someone tell me what am I doing wrong here?
Thanks,
Miguel