RE: problem with httpmodule
- From: stcheng@xxxxxxxxxxxxxxxxxxxx ("Steven Cheng")
- Date: Thu, 04 Jun 2009 03:47:53 GMT
Hi Gorge,
Are you using IIS 6 or any newer version of IIS?
For IIS6 or former version, only those ASP.NET specific document
extensions (such as .aspx, .ashx, .ascx ....) are forwarded to ASP.NET
runtime for processing. Those static content such as txt, htm, css or image
files are directly served by IIS server(for performance consideration).
If you want to let ASP.NET runtime process them, you can manually modify
the extension mapping for your ASP.NET web application's virtual directory.
Here is a tech article discusses on this:
#Configure IIS for Wildcard Extensions in ASP.NET
http://professionalaspnet.com/archive/2007/07/27/Configure-IIS-for-Wildcard-
Extensions-in-ASP.NET.aspx
If you have anything unclear, please feel free to post here.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Gorge" <a@xxxxx>
Subject: problem with httpmodule
Date: Thu, 4 Jun 2009 13:27:48 +1200
the
Now when viewing the image I get a link... so the code isn't work at all
for images if I point it to this dll. Is this the correct way I should be
doing it?
I'm quite lost. I thought the httpmodule would intercept any request to
website.OTE_ADDR"]))
Thanks
Code
a.. public class CountryFilter : IHttpModule
a.. {
a.. public void Dispose()
a.. {
a.. }
a..
a.. public void Init(HttpApplication context)
a.. {
a.. context.BeginRequest += new EventHandler(context_BeginRequest);
a.. }
a..
a.. private void context_BeginRequest(object sender, EventArgs e)
a.. {
a..
a.. HttpApplication app = (HttpApplication)sender;
a.. HttpContext context = ((HttpApplication)sender).Context;
a..
a.. // start checking country code
a.. GeoIPCountry cl = new GeoIPCountry(@"c:\\GeoIP.dat");
a..
a.. if
(cl.GetCountryCode(IPAddress.Parse(app.Context.Request.ServerVariables["REM
!= "NZ")
a.. {
a.. context.Response.StatusCode = 403;
a.. context.Response.End();
a.. }
a.. }
a.. }
.
- Follow-Ups:
- Re: problem with httpmodule
- From: Gorge
- Re: problem with httpmodule
- Prev by Date: programmatically create querystring and update sitemap node
- Next by Date: Asp net 1.1. how long?
- Previous by thread: programmatically create querystring and update sitemap node
- Next by thread: Re: problem with httpmodule
- Index(es):
Relevant Pages
|