Send page requset of page.txt to IIS.ASP

G

Guest

Hi;

This works fine on my development system but fails on IIS on Win 2003. I
have requests for filename.txt, filename.rtf, etc that must go to my ASP.NET
code. I have the following in my web.config:
<httpHandlers>
<add verb="*" path="report-create.*" type="ReportCreate"/>
<add verb="*" path="report-view.*" type="ReportView"/>
<add verb="*" path="template-file.*" type="TemplateFile"/>
</httpHandlers>

And in IIS I went for my app to properties, Directory tab, Configuration
button, and added application exceptions for .txt, .rtf, etc giving them the
executable c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll

I then restarted IIS.

But, it still does not send those requests to my code. If I use an extension
of .aspx then I do get the request.

Any ideas?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
S

Steven Cheng[MSFT]

Hello Dave,

As for the Httphanders registering ,based on my experience, the path
attributre of httphandlers <add> element in web.config can only support
wildcard in the filename part, but not the document extension. Based on my
local test, so far we can get the following path to work when registering
custom httphandler for IIS hosted ASP.NET web application:

1) path="*", the handler will process all the comming ASP.NET requests

2) path="*.ext", the handler will process all the comming ASP.NET request
point to a certain document extension type.


For your scenario, you may need to explicitly add all those extension types
in the <httphandlers> section( *.doc, *.txt, .....).

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Hi;

Tried that - still no luck.

To repeat, when running under Visual Studio, then
<add verb="*" path="report-create.*" type="ReportCreate"/>
works great.

When running on Windows 2003/IIS then
<add verb="*" path="report-create.*" type="ReportCreate"/>
<add verb="*" path="report-create.txt" type="ReportCreate"/>
both do not work for report-create.txt. And report-create.aspx does go to my
code - but then IE thinks it's xml or html and says it's a malformed file.

And it returns very very fast when I go to report-create.txt so I am
guessing ASP.NET is never given the request. Is there something I need to do
beside the MIME types in IIS to have ASP.NET get files with this extension?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
S

Steven Cheng[MSFT]

Hi Dave,

Thanks for the followup.

I've also found your another new thread below:

Newsgroups: microsoft.public.dotnet.framework.aspnet
Subject: Set IHttpHandler for all files in a directory?

I've posted my reply there and please feel free to post in that thread.


Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Steven Cheng[MSFT]

Good news :)

Seems still caused by IIS setting.

Have a good day!


Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

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,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top