Events in HTTP Modules

G

Guest

In KB article 308000 HOW TO: Create an ASP.NET HTTP Module Using Visual Basic .NET (http://support.microsoft.com/default.aspx?scid=kb;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?
 
B

bruce barker

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 said:
In KB article 308000 HOW TO: Create an ASP.NET HTTP Module Using Visual
Basic .NET (http://support.microsoft.com/default.aspx?scid=kb;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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top