473,395 Members | 1,680 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,395 software developers and data experts.

Question re Event Publishing

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 of the event handler.
If the event generates no data, use the predefined EventHandler delegate.
2. Define an event based on the delegate type defined in the preceding step.
3. Define a protected, virtual method that raises the event.
4. When the event occurs int he environment, invoke the protected, virtual
method defined in the preceding step.

Now, the sample that illustrates these steps includes the following code,
which is run on the server:

' ----------------
' Begin Publishing
' ----------------

' Define the event
Public Event MyEvent As EventHandler

' Notify the registered objects of the event
Protected Sub OnMyEvent(ByVal e As eventargs)
RaiseEvent MyEvent(Me, e)
End Sub

' Raise MyEvent when the page is loaded
Protected Overrides Sub OnLoad(ByVal e As eventargs)
OnMyEvent(e)
MyBase.OnLoad(e)
End Sub

' --------------
' End Publishing
' --------------

I can clearly see steps 1, 3, and 4 in the code. Where the blazes is step 2?
I have looked at this until I'm blue in the face. I missed this question on
the review exercises because I based my answers on the steps I coded, and I
clearly don't see a step 2.

Any help you guys could provide would be greatly appreciated.

(For your information, the book in question is MCAD/MCSD Developing and
Implementing Web Applications with Visual Basic .NET and Visual Studio .NET
by Mike Gunderloy, published by Que Certification.)
Nov 18 '05 #1
0 973

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

Similar topics

4
by: support.services.complaints | last post by:
Ok i have a wxFrame with a wxNotebook that has two wxPanels, lets call them panel_1 and panel_2 i have wxTextCtrl in panel_1 (call it panel_1_ctrl) that i want the user to be able to fill up. I...
0
by: MarionEll | last post by:
XML 2003 to Highlight Key Publishing Trend: XSL-FO Tools XSL-FO “Chef’s Tools Exhibition” Slated for 7 p.m. Dec. 10; Premier XML Industry Event Runs Dec. 7-12 in Philadelphia Alexandria,...
2
by: Wavemaker | last post by:
The canonical way of declaring delegates for events is to include a parameter representing the sender as well as an EventArgs derived class (or EventArgs itself) as the second parameter...
2
by: ETL | last post by:
Hi, I think this question has an easy answer but I can't seem to find anything online that lists best practices for my problem. I have a C# app that uses an exception handling tree similar to...
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...
2
by: Geek | last post by:
Guys, I have a question regarding publishing web site using visual studio 2005. As usual I am running in to issues using visual studio 2005. I have build a web site and when I publish to the...
4
by: Joey | last post by:
asp.net 2/C#/VS2005 I have a web app that uses a third party control. The control requires a license file that is located in the root folder of the website. Each time I publish the website,...
11
by: cj | last post by:
Perhaps someone knows how to do this. When I open a new ASP.NET web service application in VS 2008, it opens with a simple Hello World web service already written. I want to see this work. ...
6
by: tshad | last post by:
I was looking at a page that showed how to set up a custom event and it seems to work ok. But I am not sure how I would use it. How would I subscribe to it. There is actual action (such as...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.