473,405 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Event question

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
0 1465

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
21
by: Alo Sarv | last post by:
Hi From what I have understood from various posts in this newsgroup, writing event loops pretty much comes down to this: while (true) { handleEvents(); sleep(1); // or _sleep() or...
2
by: Dominic | last post by:
Hi guys, I'm not sure if this question belongs to FAQ, but I couldn't find a concrete answer. I created a Datagrid control using ItemTemplate, but it's NOT a in-place editing datagrid. One of...
2
by: JollyK | last post by:
Hi friends, This is my question.... From the Page Load event (or Page Init event), I would need to find which event had occurred that caused a PostBack, for example was it a event fired from...
0
by: Mike hofer | last post by:
I am studying up for my MCAD, and came across an interesting conundrum. According to my textbook, there are FOUR steps to publish an event: 1. Define a delegate type that specifies the prototype...
5
by: Mike Salter | last post by:
I created a page that reads a DB for questions and possible answers (usuallyYes/No). I create a panel for each group of questions, and add a panel for each question to the Group panel. To the...
6
by: Tim | last post by:
Hi, I have a module that acts as a publisher of events. The clients subscribe for the events using the '+=' operator. Instead, I would like the clients to call a method like "RegisterForXEvent"...
10
by: jack | last post by:
Hi guys, I am working on a project which requires an implementation of discrete event simulation in C using linked lists. I would greatly appreciate if someone could provide with some sources...
3
by: jm | last post by:
>From a C. Petzold book I have Programming Windows C#. It's a little old now, but anyway, it has on page 71 (shortened): form.Paint += new PaintEventHandler(MyPaintHandler); static void...
4
by: tshad | last post by:
I am just getting started with events and had a couple of questions on why they do what they do. If you have a textbox and you want to handle an event you can just do: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.