HTML file server side includes plus forms authentication

  • Thread starter William F. Zachmann
  • Start date
W

William F. Zachmann

We've got a project going that involves moving an old web site with a
massive dll written in C++ that produces most of the output from a SQL 7.0
data base on NT4 onto IIS on Windows 2003 Server with SQL 2000. All new
code is being written in C# using ASP.NET and we are using forms
authentication to control access to particular directories/applications.

We are having a hard time figuring out how to configure the thing so that
existing html files both a) have access controlled through ASP.NET forms
authentication and b) render server side includes correctly. If we
configure the htm/html files for the application on IIS to be handled by
ssinc.dll the includes are rendered correctly, but access is not restricted
by forms authentication. If we configure them to be handled by
aspnet_isapi.dll we get forms authentication control, but the includes are
ignored.

Oddly, simply renaming a file from *.html to *.aspx with no other changes
results in aspnet_isapi.dll handling it correctly -- providing forms
authentication access control and also rendering includes correctly. But if
the file name is *.htm or *.html, aspnet_isapi.dll fails to include the
includes. It almost seems like this is a bug! I cannot, at any rate, see
any reason why it would do this by design.

So, in theory, we could solve the problem by just re-naming all our htm/html
files with an aspx extension instead. Unfortunately this is not so easily
done in practice since the old C++ .dll that creates most pages and fills
them with stuff from the data base has hyperlinks to the *.html files hard
coded into it all over the place. It is not impossible to change this, but
we'd like to find a simpler way.

Can anyone offer a suggestion for a way to resolve this problem? Is it
simply a bug that aspnet_isapi.dll renders includes for *.aspx files but
fails to do so for an otherwise identical files with a .htm or .html
extension?

All the best,

will

William F. Zachmann, President
Canopus Research Inc.
http://www.canopusresearch.com
 
G

Guest

Hi William!
Is it
simply a bug that aspnet_isapi.dll renders includes for *.aspx files but
fails to do so for an otherwise identical files with a .htm or .html
extension?

I don't think it's a bug. Probably your IIS is configured in way that
*.aspx files are handled by aspnet_isapi.dll, but .htm/.html are not. To
change this mapping (for IIS 6) go to "Application settings" (tab "Home
directory" or "Virtual directory")
"Application settings", click "Configuration". On the "Mapping" tab, have a
look at the "Application extension", especially the ".aspx" mapping. Create
a similar extension mapping for ".htm" and ".html".
Now IIS will handle your .htm files using aspnet_isapi.dll. If you still
need more control you will need a custom http handler.

Alex

http://www.DotNet42.com - The Answer to Your DotNet Question
 
W

William F. Zachmann

Alex,

Apparently I was not clear enough. I had already done that. IIS is already
handling my htm/html files through aspnet_isapi.dll. That brings them under
forms control access, but the includes are not rendered correctly. If I
re-name them to *.aspx, then they are handled correctly. Named *.htm/html
(with those extensions mapped to aspnet_isapi.dll) forms control works, but
includes are not rendered. If I map them to ssinc.dll, then includes are
rendered but I get no forms based access control.

All the best,

will
 
B

Bruce Barker

asp.net processing is a two part

1) map file extension to asp.net dll - this enables form authenication
2) <@ page > directive is found, this causes the page to processed as an
asp.net page and implements the include logic.

you can just add the <@page> directive to your html pages and you're good to
go.

-- bruce (sqlwork.com)
 
W

William F. Zachmann

Alex,

Thanks for your intention to help however, if you read through my original
message, you will see that I have already considered the possibility of
simply re-naming the htm/html files with aspx extensions but that this is
not a very good option since the old (massive) C++ dll has many hard-coded
dependencies tied to the file (and, for that matter, directory) names. I
quite explicitly said that I was looking for another alternative.

All the best,

will
 
W

William F. Zachmann

Bruce,

Sounds like you have provided the specific information I needed. I will try
that out to confirm that it works. Thanks very much!

All the best,

will
 

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,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top