Some problem with HttpModule

H

Hardy Wang

Hi all,
I built a HttpModule for one of my ASP.NET application to handle some
special file format (*.DEC1, *. DEC2). My code is like below
public class MyClass : IHttpModule {
public MyClass() {
}

public bool IsReusable {
get { return false; }
}

private HttpApplication mApplication;
public void Init(HttpApplication application) {
// Save off the application
mApplication = application;

// Wire up the begin request
mApplication.BeginRequest += new EventHandler(this.RewritePathHandler);
}

private void RewritePathHandler(object sender, EventArgs e) {
System.Web.Mail.MailMessage m = new System.Web.Mail.MailMessage();
m.From = "a";
m.To = "(e-mail address removed)";
m.Subject = "URL Requested";
m.Priority = System.Web.Mail.MailPriority.Normal;
m.BodyFormat = System.Web.Mail.MailFormat.Text;
m.Body = mApplication.Request.Path;
System.Web.Mail.SmtpMail.Send(m);
}
}

I also register file extension DEC1 and DEC2 in IIS, executable as
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll, Extension as
..DEC1 and .DEC2.

I added HttpModule handler in web.config.

Now my problem is, if I request any ASPX file, I can get email notification
of which file I accessed. But if I request my customerized .DEC1 or .DEC2
file, I received nothing, just like HttpModule is not triggered at all.

I have the samething on a different server, it is fine. Just not good on
this server.

Anybody has suggestion, which setting do I need to look into to fix this
problem?

Thanks!
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top