HttpHandler and Page Not Found

G

Guest

Hi,

I created this HttpHandler, very simple:

using System;
using System.Web;

namespace HttpHandlerTest
{
public class HelloWorldHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.Write("<html><body><h4>");
context.Response.Write("Hello World!");
context.Response.Write("</h4></body></html>");
}

public bool IsReusable
{
get
{
return true;
}
}
}
}

in the <httpHandlers> element of my virtual directory's web.config it looks
like this:

<configuration>
<system.web>
<httpHandlers>
<add verb="POST,GET"
path="hello/*.ashx"
type="HttpHandlerTest.HelloWorldHandler, HttpHandlerTest" />
</httpHandlers>
</system.web>
</configuration>

I request this page:
http://localhost/myAppsVirtualDirectory/hello/world.ashx
and it works like a champ, returning the Hello World! as it should.

I take the same assembly and put in an evironment where my app is a virtual
directory underneath another virtual directory and under https, so
requesting a page from my app would go like this:
https://address/virtualdirectory1/myAppsVirtualDirectory/somepage.aspx
and that works fine.

however, when I put my HttpHandlerTest assembly in the bin directory, and
update the web.config as posted above and make this request:
https://address/virtualdirectory1/myAppsVirtualDirectory/hello/world.ashx
I get a standard "Page Not Found" 404 response.

I know .ashx files are being served up from the same spot, I put the
following file(Test.ashx) in my apps directory and requested it with no probs:
<%@ WebHandler Language="C#" Class="Test" %>
using System;
using System.IO;
using System.Web;
using System.Drawing;
using System.Drawing.Imaging;
public class Test : IHttpHandler
{
public bool IsReusable
{
get{ return true; }
}
public void ProcessRequest(HttpContext context)
{
context.Response.Write("Hello! from the ashx page...");
}
}

I know it's hitting the httpHandlers section because in my random attempts
at fixing the prob i stuck <clear /> as the first
element in the httpHandlers section and the app blew up, no "Get" handler,
which makes sense.

I know on the back end that https://address is translated into
http://address:48085 on the actual web server, which really shouldn't
matter...or does it?

I've tried different path combos as well:
path="https//address/virt1/myapp/hello/*.ashx"
path="http//address:48085/virt1/myapp/hello/*.ashx"
path="~/hello/*.ashx"

my local workstation is Windows XP service pack 1, .NET 1.1 NO .NET SERVICE
PACK INSTALLED
the target machine is a windows 2003 box, no service pack, .NET 1.1 WITH
..NET 1.1 service pack 1

anyone have any ideas why this might not be working?

thanks,

Chris
 

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,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top