By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,230 Members | 2,436 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,230 IT Pros & Developers. It's quick & easy.

Events in HTTP Modules

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
Cool - Thanks Bruce
Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.