473,507 Members | 9,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Some problem with HttpModule

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 = "my****@company.com";
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\aspne t_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!

--
WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours Hardy
Nov 19 '05 #1
1 1323
I ended found that URL contains some invalid characters.

--
WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours Hardy
"Hardy Wang" <ha*******@hotmail.com> wrote in message
news:Od*************@TK2MSFTNGP10.phx.gbl...
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 = "my****@company.com";
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\aspne t_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!

--
WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours Hardy

Nov 19 '05 #2

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

Similar topics

1
1421
by: poi | last post by:
I have an HttpModule defined in my web.config, sometimes I want to use it and sometimes I don't. Is there a way to declare whether I need it or not in my code-behind? Thanks. *** Sent via...
1
1640
by: Ryan Cromwell | last post by:
I have written an httpModule for use in our test environment. If a user goes to http://testserver/SomeApplication/MyPage.aspx it will resolve to the latest version of that application deployed:...
2
1545
by: Michael Appelmans | last post by:
I have implemented an httpmodule class and added it in the web.config, but when I try and use Context.RewritePath I get error: The virtual path "/searchresult?categoryid=104" maps to another...
4
3899
by: Danny W | last post by:
Hi There! Is it possible to use HttpModule to replace the built-in ASP.NET Session object? I want to write a HttpModule that will handle storing and retrieving of session values from an external...
1
1851
by: Mike Kline | last post by:
Hi There! How do I make the Objects in the custom made HttpModule available to ASPX page or ASCX controls without requiring an object reference? For example, SessionState HttpModule made the...
2
2126
by: Simon-Pierre Jarry | last post by:
Hi, I created a custom HttpModule for managing the security of my application. in "Init" sub, I regsiter the events doing that : Public Sub Init(ByVal context As System.Web.HttpApplication)...
2
4568
by: walter | last post by:
Hi there, I know there is pool of HttpApplications, and for each request coming in, HttpRuntime will dedicate one from pool to serve the request. My questions are : 1. since HttpModule is plug...
1
1883
by: Faraz | last post by:
Hi everyone, I am running into a slight problem. My understanding is that a custom HttpModule will run for every request made to the server, regardless of the extension. I do not experience this...
1
1788
by: =?Utf-8?B?TmF2YW5lZXRoLksuTg==?= | last post by:
Hello, I am designing a HTTPModule that tracks and logs all pages visited by user. I am succeeded in that. Now to provide much better experience for the person who monitor's these logs, I need...
0
7223
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,...
0
7110
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7314
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,...
0
7372
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...
1
7030
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...
0
7482
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...
0
5623
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,...
0
4702
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...
0
411
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...

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.