473,806 Members | 2,944 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Overrides IHttpModule

I am trying to implement the global error handling described on this page...
http://www.dotnetdevs.com/articles/G...rHandling.aspx

I'm a VB person and don't understand much of C# when it gets more
complicated. Can someone please help me with the following statement that
is in C#, I need this in VB and have been using Patel's converter but just
can't get rid of the errors in VS.NET.

void IHttpModule(Htt pApplication application) {
_application = application;
_application.Er ror += new EventHandler(Er rorHandler);
}
ERROR:
'Public Event Error(sender As Object, e As System.EventArg s)' is an event,
and cannot be called directly. Use a 'RaiseEvent' statement to raise an
event.

It's choking on the 2nd line of code.

Thanks so much!
Nov 21 '05 #1
6 1400
Andy,
void IHttpModule(Htt pApplication application) {
_application = application;
_application.Er ror += new EventHandler(Er rorHandler);
}

Private Sub IHttpModule(Htt pApplication application)
_application = application;
AddHandler _application.Er ror, AddresOf ErrorHandler
End sub

I hope this helps,

Cor
Nov 21 '05 #2
Andy,
void IHttpModule(Htt pApplication application) {
_application = application;
_application.Er ror += new EventHandler(Er rorHandler);
}

Private Sub IHttpModule(Htt pApplication application)
_application = application;
AddHandler _application.Er ror, AddresOf ErrorHandler
End sub

I hope this helps,

Cor
Nov 21 '05 #3
Cor,
Close :-)
Private Sub IHttpModule(ByV al application As HttpApplication )
_application = application
AddHandler _application.Er ror, AddressOf ErrorHandler
End sub
However the AddHandler is the important part ;-)

My Concern is this method is a constructor or not...

Hope this helps
Jay
"Cor Ligthert" <no************ @planet.nl> wrote in message
news:u8******** ********@TK2MSF TNGP12.phx.gbl. .. Andy,
void IHttpModule(Htt pApplication application) {
_application = application;
_application.Er ror += new EventHandler(Er rorHandler);
}

Private Sub IHttpModule(Htt pApplication application)
_application = application;
AddHandler _application.Er ror, AddresOf ErrorHandler
End sub

I hope this helps,

Cor

Nov 21 '05 #4
Cor,
Close :-)
Private Sub IHttpModule(ByV al application As HttpApplication )
_application = application
AddHandler _application.Er ror, AddressOf ErrorHandler
End sub
However the AddHandler is the important part ;-)

My Concern is this method is a constructor or not...

Hope this helps
Jay
"Cor Ligthert" <no************ @planet.nl> wrote in message
news:u8******** ********@TK2MSF TNGP12.phx.gbl. .. Andy,
void IHttpModule(Htt pApplication application) {
_application = application;
_application.Er ror += new EventHandler(Er rorHandler);
}

Private Sub IHttpModule(Htt pApplication application)
_application = application;
AddHandler _application.Er ror, AddresOf ErrorHandler
End sub

I hope this helps,

Cor

Nov 21 '05 #5
Jay,

I (and you) saw only have only that part of the code, so only on that I can
answer.

I was first thingking where comes that from. Although not completly
understanding what you mean, do I probably agree with what you wrote.

My thought was when it is not working, there will be a reply again, and that
is probably better than to ask for a more detailed question.

Cor
Nov 21 '05 #6
Jay,

I (and you) saw only have only that part of the code, so only on that I can
answer.

I was first thingking where comes that from. Although not completly
understanding what you mean, do I probably agree with what you wrote.

My thought was when it is not working, there will be a reply again, and that
is probably better than to ask for a more detailed question.

Cor
Nov 21 '05 #7

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

Similar topics

0
1175
by: moid | last post by:
Sir we are implementing front controller in asp.net. we implement three event-handler 1. PreRequestHandlerExecute 2. PostRequestHandlerExecute 3. BeginRequest we just want to initialize the page, but dont want to load it. After BeginReq the page should Load. becuse we need to fill Datagrid through Command
2
2378
by: Kenneth Myhra | last post by:
Hi, We have been trying to develop an IHTTPModule (that was supposed to replace or take over the ISAPI Filters, as far as we know). We have developed one in C# and it seems to be working. The problem is that it is not working as it is supposed to work and we *need* to debug it. We made a search on MSDN already. Either my search keywords were irrelevant (we used <IHTTPModule debug> and <IHTTPModule debugging>, without the greater and...
2
1655
by: Kenneth Myhra | last post by:
Hi all, We are trying to make an ISAPI Filter, in .NET by implementing the IHttpModule interface, that will authorize the request for certain binary file types (GET), this is working fine. But we also want it to authorize the upload of binary files (PUT), The problem with the PUT-scenario is that the file is *not* uploaded when its extension *is* mapped up in IIS, by mapped up I mean the Application Mappings displayed when clicking on the...
5
2366
by: Andrew Lippitt | last post by:
What gaurantees are there in the way of which thread the events are called from. I've seen: Thread A Begin Thread B Begin Thread A End Thread A End That seems to indicate that Begin and End can't be assumed to be called from the same thread, but can I assume that the Begin will happen on the same thread that executes the request?
6
4186
by: Simone Busoli | last post by:
Hello, I am trying to understand when IHttpModule.Dispose method is called. Is it called when the Application is disposed, or when the request ends? If I want to make an object Application-wide and close it when the application ends can I use that method or write something like this in the class that implements the IHttpModule? public void Init(HttpApplication application) { application.Disposed +=new...
5
2192
by: Richard | last post by:
I've developed a small ASPX template framework (based on Chun Li's article on CodeProject: http://www.codeproject.com/aspnet/headerfooter.asp#xx849313xx) which uses a IHttpModule to apply usercontrols (e.g. header and footer) on pages. The module determines if templates should be added to the page using Page.Request.Path. It matches the current adress to settings found in a configuration-file... It works like a charm except for one...
1
1981
by: Osama Sayed | last post by:
I have a class that implements IHttpModule to handle URLs with a "RESTful" nature. It handles them according to a custom configuration section in the website's Web.Config file. My questions are: 1. Does each client call result in a new instance of my IHttpModule class being created? 2. Is it better to re-read my custom configuration each time or to add a static member field containing my class that inherits from ConfigurationSection so...
8
2928
by: =?Utf-8?B?UGhpbGlw?= | last post by:
When is the IHttpModule Dispose driven ?....at application recycle time ? I developed a test HttpModule to trace INIT, BeginRequest, EndRequest and Dispose....and the Dispose never gets driven. After a while the INIT is redriven however the Dispose was never driven. I am trying to locate the best means to hook ASP.NET application recycling ...... Is IHttpModule Dispose a solution for this and if so how ?...... or should I use...
1
1468
by: Eric Goforth | last post by:
Hello, I found a C# example on the web that used an httpmodule. I've translated it to VB.NET and the website compiles fine, but when I build the website the iHttpModule doesn't compile, I can't figure out why. I do have the following entry in my web.config file: <system.web><httpModules><add name="MyModule" type="MyModule.MyModule"/ My iHttpModule Class implements iHttpModule (of course). I also have
0
9719
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
10620
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...
1
10372
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
10110
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
9187
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
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
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
5682
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3008
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.