473,809 Members | 2,695 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1007

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

Similar topics

4
1276
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 then want the user to be able to click a button (i.e. create an EVT) and have Value() of panel_1_ctrl be sent a wxTextCtrl in panel_2. So can i do this directly, i.e. is there a way to tell panel_2 that something has happended in panel_1 and to...
0
1890
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, Va. October 7, 2003 - IDEAlliance, a leading trade association dedicated to fostering XML and other information technology standards, today announced that XML Conference and Exposition 2003 will feature an XSL-FO “Chef’s Tools Exhibition”...
2
1946
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 representing the data that accompanies the event. For example: public delegate void MessageReceivedHandler(object sender, MessageReceivedArgs e); // ...
2
1511
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 the following. Try { blah blah blah....
5
3372
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 Question panel I add a label with the question text, and a radiobuttonlist with the answers. I have an eventhandler I add to each radiobuttonlist, which is the same for all. The Group panels are then added to Placeholder1.Controls. I then add...
2
2405
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 local host it is running perfectly now after spending couple of hours. Now the questions is whenever I transfer all the published website to production server it is giving me error <!-- Web.Config Configuration File -->
4
1807
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, VS2005 does not recognize the file as one that should be published, like an aspx or cs file, etc...so it does not copy it to the web server folder. So each time after publishing I have to manually copy the license file by using Windows Explorer. I...
11
3010
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. Without changing a thing I built the solution and published it to localhost default web site. How can I test it?????
6
1886
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 pressing a button or changing text in a textbox). It gets set up and on the user control on my web page I can see the event from intellisense. So it seems to be set up, but I am trying to get an easy example of how I would now use this event. ...
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10639
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10383
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5688
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.