By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,727 Members | 766 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,727 IT Pros & Developers. It's quick & easy.

Event question

P: n/a
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

Nov 10 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.