473,383 Members | 1,805 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,383 software developers and data experts.

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(HttpApplication application) {
_application = application;
_application.Error += new EventHandler(ErrorHandler);
}
ERROR:
'Public Event Error(sender As Object, e As System.EventArgs)' 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 1380
Andy,
void IHttpModule(HttpApplication application) {
_application = application;
_application.Error += new EventHandler(ErrorHandler);
}

Private Sub IHttpModule(HttpApplication application)
_application = application;
AddHandler _application.Error, AddresOf ErrorHandler
End sub

I hope this helps,

Cor
Nov 21 '05 #2
Andy,
void IHttpModule(HttpApplication application) {
_application = application;
_application.Error += new EventHandler(ErrorHandler);
}

Private Sub IHttpModule(HttpApplication application)
_application = application;
AddHandler _application.Error, AddresOf ErrorHandler
End sub

I hope this helps,

Cor
Nov 21 '05 #3
Cor,
Close :-)
Private Sub IHttpModule(ByVal application As HttpApplication)
_application = application
AddHandler _application.Error, 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****************@TK2MSFTNGP12.phx.gbl... Andy,
void IHttpModule(HttpApplication application) {
_application = application;
_application.Error += new EventHandler(ErrorHandler);
}

Private Sub IHttpModule(HttpApplication application)
_application = application;
AddHandler _application.Error, AddresOf ErrorHandler
End sub

I hope this helps,

Cor

Nov 21 '05 #4
Cor,
Close :-)
Private Sub IHttpModule(ByVal application As HttpApplication)
_application = application
AddHandler _application.Error, 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****************@TK2MSFTNGP12.phx.gbl... Andy,
void IHttpModule(HttpApplication application) {
_application = application;
_application.Error += new EventHandler(ErrorHandler);
}

Private Sub IHttpModule(HttpApplication application)
_application = application;
AddHandler _application.Error, 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
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...
2
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...
2
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...
5
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...
6
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...
5
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...
1
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:...
8
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. ...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.