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!
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!