473,394 Members | 2,052 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,394 software developers and data experts.

Events in HTTP Modules

In KB article 308000 HOW TO: Create an ASP.NET HTTP Module Using Visual Basic .NET (http://support.microsoft.com/default...;EN-US;308000), a simple HTTP Module is created which, among other things, raises a user defined event in the BeginRequest handler. it is defined as (in the HTTP Module

Public Delegate Sub MyEventHandler(ByVal s As Object, ByVal e As EventArgs
Public Event MyEvent As MyEventHandle

and is handled in the global.asax a

Public Sub MyModule_OnMyEvent(src As Object, e As EventArgs)
Context.Response.Write("Hello from MyModule_OnMyEvent called in Global.asax.<br>"
End Su

if you change the signature t

Public Delegate Sub MyEventHandler(byval msg as string

and use in global.asa

Public Sub MyModule_OnMyEvent(byval msg as string)
Context.Response.Write(msg & "<br>"
End Sub

wit

RaiseEvent MyEvent("Request Event"

in the HTTP module, the event doesn't seem to take place.

Do event like this have to have a particular signature?
Nov 18 '05 #1
2 1393
you cannot change the signature, as reflection is used by the global.asx to
implement the automatic binding. you create your own event arg that had a
string property.

-- bruce (sqlwork.com).

"Dave" <an*******@discussions.microsoft.com> wrote in message
news:36**********************************@microsof t.com...
In KB article 308000 HOW TO: Create an ASP.NET HTTP Module Using Visual Basic .NET (http://support.microsoft.com/default...;EN-US;308000),
a simple HTTP Module is created which, among other things, raises a user
defined event in the BeginRequest handler. it is defined as (in the HTTP
Module)
Public Delegate Sub MyEventHandler(ByVal s As Object, ByVal e As EventArgs) Public Event MyEvent As MyEventHandler

and is handled in the global.asax as

Public Sub MyModule_OnMyEvent(src As Object, e As EventArgs)
Context.Response.Write("Hello from MyModule_OnMyEvent called in Global.asax.<br>") End Sub

if you change the signature to

Public Delegate Sub MyEventHandler(byval msg as string)

and use in global.asax

Public Sub MyModule_OnMyEvent(byval msg as string)
Context.Response.Write(msg & "<br>")
End Sub

with

RaiseEvent MyEvent("Request Event")

in the HTTP module, the event doesn't seem to take place.

Do event like this have to have a particular signature?

Nov 18 '05 #2
Cool - Thanks Bruce
Nov 18 '05 #3

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

Similar topics

2
by: Dave Boland | last post by:
I read a lot of discussion about callback functions as used in C (as in qsort for example). I'm comfortable with this as it is really a function pointer. What I'm not totally clear about is how...
5
by: Rekkie | last post by:
Hi, All of our developers using C# VS.Net 2003 to develop websites are having problems with Events being deleted from their code by Visual Studio. It seems that object events defined in the...
1
by: Natalia DeBow | last post by:
Hi, I am working on a Windows-based client-server application. I am involved in the development of the remote client modules. I am using asynchronous delegates to obtain information from...
1
by: dt | last post by:
I'm trying to create a drop-in dll that will run as a module on an existing application with just one web.config change. However, it is necessary to maintain state within the module. I don't think...
14
by: Xah Lee | last post by:
sometimes in the last few months, apparently Microsoft made changes to their JavaScript documentation website: ...
1
by: zpinhead | last post by:
I am unable to get my downloaded extension from pecl to link up with php properly. seems like the php.so I could not use pear install http. pear claimed the extension was already installed....
3
by: Radu Ciurlea | last post by:
Hello, I want to write a program that can generate mouse events. I'd like to actually be able to control the pointer and generate clicks. Any pointers on modules I could use for doing this? Any...
2
by: Gary W. Smith | last post by:
I have a page that inherits from a base page that is currently overriding all of the On* events. For the most part I'm accomplishing everything I set out to do with the inheritance, but I wanted...
1
by: swethak | last post by:
Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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.