How to incorporate html files in asp.net site?

K

Keith

I have an IIS 6.0 web server hosting an ASP.NET 2.0 web site. Help files for
the site are pure html. Is there some way to serve these html pages using
the same ASP.NET web site? If so, how do I include them in my ASP.NET
project?

Thanks,

Keith
 
J

Juan T. Llibre

If you want the html files to be handled by the ASP.NET engine,
you have to add the .html file type in the "configuration" option
for the specific application in the Internet Service Manager.

If you want the html files to process Asp.Net instructions,
you'll also need to modify your web.config :

<compilation>
<buildProviders>
<add extension=".html" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>
<httpHandlers>
<add path="*.html" verb="*" type="System.Web.UI.PageHandlerFactory" />
</httpHandlers>

Of course, if all you want is to serve html files from within an
ASP.NET application, all you need to do is provide an html link for them.

IIS will serve html files in any ASP.NET application directory.
 
P

Patrice

With VS.NET ? You should just be able to add an HTML page item to your
project as for any other item type... Have you tried ? What is the problem
it caused ?
 
E

Eliyahu Goldin

Keith,

From the project perspective there is no difference between .aspx an .html
files. Just use Add New/Existing Item menu. From the web site perspective
the difference is that .html files will go to client as they are whereas
..aspx ones will be processed by asp.net.
 

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,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top