By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,180 Members | 1,012 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,180 IT Pros & Developers. It's quick & easy.

ASP.NET Httphandler and file names with ampersand = 404 Error. Please help.

P: n/a
I want to process requests to certain image files that have a custom
..icon(32x32) extenstion with a custom .NET HttpHandler in order to be able
to tap into Application events. This works fine almost everytime except that
I get a 404 error when trying to access a file with an ampersand in its
name. The error happens only if I point the aspnet_isapi.dll to the .NET
Framework 1.1. If I use the aspnet_isapi.dll of the old .NET framework
(1.0), I get no errors. Do you have any ideas?

Here is what I am doing:

1. I have a class implementing IHttpHandler interface. The ProcessRequest()
method simply writes the .icon(16x16) file to the virtual directory and the
subsequent HTTP request for the icon gets the file from the virtual
directory.

2. Web.config file contains this entry:
<httpHandlers>
<add verb="GET,HEAD,POST,DEBUG" path="*.icon(32x32)"
type="MyHandler, MyAssemblyName" />
</httpHandlers>

3. There is the mapping of the ".icon(32x32)" file extension to .NET
Framework aspnet_isapi.dll with the verbs "GET,HEAD,POST,DEBUG" in my web
application directory.

I am running IIS 5.0 and .NET Framework 1.1. As I said, using the old .NET
Framework in my ISAPI mappings
(C:\WINNT\Microsoft.NET\Framework\v1.0.3705\aspnet _isapi.dll), I have
absolutely no problems. Did MS change something? Maybe some new security
restrictions that is causing this to happen??
Thanks,
Prasanna
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
The ampersand character is a URL character for separating the URL from the
QueryString. IOW, if you request, for example:

http://www.yoursite.com/foo&bar.icon

The web server will identify the ampersand as the end of the URL and the
beginning of the query string.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Prasanna Padmanabhan" <pr*******@citrix.nospam.com> wrote in message
news:e6**************@TK2MSFTNGP10.phx.gbl...
I want to process requests to certain image files that have a custom
.icon(32x32) extenstion with a custom .NET HttpHandler in order to be able
to tap into Application events. This works fine almost everytime except that I get a 404 error when trying to access a file with an ampersand in its
name. The error happens only if I point the aspnet_isapi.dll to the .NET
Framework 1.1. If I use the aspnet_isapi.dll of the old .NET framework
(1.0), I get no errors. Do you have any ideas?

Here is what I am doing:

1. I have a class implementing IHttpHandler interface. The ProcessRequest() method simply writes the .icon(16x16) file to the virtual directory and the subsequent HTTP request for the icon gets the file from the virtual
directory.

2. Web.config file contains this entry:
<httpHandlers>
<add verb="GET,HEAD,POST,DEBUG" path="*.icon(32x32)"
type="MyHandler, MyAssemblyName" />
</httpHandlers>

3. There is the mapping of the ".icon(32x32)" file extension to .NET
Framework aspnet_isapi.dll with the verbs "GET,HEAD,POST,DEBUG" in my web
application directory.

I am running IIS 5.0 and .NET Framework 1.1. As I said, using the old .NET
Framework in my ISAPI mappings
(C:\WINNT\Microsoft.NET\Framework\v1.0.3705\aspnet _isapi.dll), I have
absolutely no problems. Did MS change something? Maybe some new security
restrictions that is causing this to happen??
Thanks,
Prasanna

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.