473,810 Members | 2,948 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_OnMyEv ent(src As Object, e As EventArgs)
Context.Respons e.Write("Hello from MyModule_OnMyEv ent 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_OnMyEv ent(byval msg as string)
Context.Respons e.Write(msg & "<br>"
End Sub

wit

RaiseEvent MyEvent("Reques t 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 1411
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*******@disc ussions.microso ft.com> wrote in message
news:36******** *************** ***********@mic rosoft.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_OnMyEv ent(src As Object, e As EventArgs)
Context.Respons e.Write("Hello from MyModule_OnMyEv ent 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_OnMyEv ent(byval msg as string)
Context.Respons e.Write(msg & "<br>")
End Sub

with

RaiseEvent MyEvent("Reques t 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
3290
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 (or if) a callback differs from an event such as GUI's use. One of the things I found about events, at least in a VB6 project I did, is that an event can be broadcast to all objects and they can use it if desired (code only and GUI objects). ...
5
1316
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 properties window work for a while during debugging, and after a while visual studio decides that it doesn't like the events anymore and it cancels them however leaves intact the associated code that is called by the event. As far as I have been...
1
2843
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 remote server and display this info on the UI. From doing some research, I know that the way my implementation works today is not thread-safe, because essentially my worker thread updates the UI, which is BAD. So, here I am trying to figure out how...
1
1046
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 that I'm using the events correctly. Can I only manipulate session between AcquireState and ReleaseState events? Does that mean in BeginRequest or EndRequest, the session is off limits? I keep getting "not a reference," and, well, that seems to...
14
1920
by: Xah Lee | last post by:
sometimes in the last few months, apparently Microsoft made changes to their JavaScript documentation website: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/1e9b3876-3d38-4fd8-8596-1bbfe2330aa9.asp so that, one has to goddamn press the "expand" button to view the documentation, for every goddamn page. What the fuck is going on?
1
4292
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. that is certainly not true. I downloaded the http extension from pecl. cvs -d:pserver:cvsread@cvs.php.net:/repository co pecl/http
3
2208
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 suggestions are welcome. tia Radu
2
3194
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 to get a little more information to lock down what I think I know and also to answer a couple little questions. Given a base page, and the page inheriting it, as I understand it, the page lifecycle flows like this: 1) Page is requested
1
4911
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 events when click on that date that perticular event displyed in a text box.But my requirement is to when click on that date that related event displyed in same td row not the text box. and also i add the events to that calendar.plz advice how to...
0
9722
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10643
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
10378
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
10391
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
10121
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
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 project—planning, coding, testing, and deployment—without 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
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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.