Need .htm to go to both ASP.NET and for files

G

Guest

Hi;

This appears to be a bit of a problem. Our portal's help system is composed
of .htm files. So if the requested file is application/help/datasource.htm,
that is a file on disk that should be returned by IIS.

We also have htm files (reports) that are stored in the database. Those are
returned using:
<httpHandlers>
<add verb="*" path="report-view.*" type="ReportView"/>
</httpHandlers>

And for these we have to set it in IIS that .htm files are passes to ASP.NET
and do not require that the file exists.

However, when we set this in IIS, then the help.htm files are not returned.
How can we set it that if an httpHandler handles it. it returns the .htm file
but otherwise it looks on disk for the file.

It seems to me there must be a way to do this because this must be a common
need - htm files returned by both HttpHandlers and as files on disk.

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

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

Guest

Hi;

This appears to be a bit of a problem. Our portal's help system is composed
of .htm files. So if the requested file is application/help/datasource.htm,
that is a file on disk that should be returned by IIS.

We also have htm files (reports) that are stored in the database. Those are
returned using:
<httpHandlers>
<add verb="*" path="report-view.*" type="ReportView"/>
</httpHandlers>

And for these we have to set it in IIS that .htm files are passes to ASP.NET
and do not require that the file exists.

However, when we set this in IIS, then the help.htm files are not returned.
How can we set it that if an httpHandler handles it. it returns the .htm file
but otherwise it looks on disk for the file.

It seems to me there must be a way to do this because this must be a common
need - htm files returned by both HttpHandlers and as files on disk.

Try to add

<add path="/application/help/*.htm" verb="*"
type="System.Web.StaticFileHandler" />
 
S

Steven Cheng[MSFT]

Hi Dave,

As long as you've add the ".htm" extension mapping (in IIS virtual dir
configuration setting) to aspnet_isapi.dll, those .htm requests will be
handled by ASP.NET runtime rather than IIS's original static file
extensions. Therefore, if you haven't a dedicated handler for those
configured extensions(and want to serf them as normal static documents),
you need to add the "StaticFileHandler" for them in web.config
<httphandlers> section

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

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top