views:

692

answers:

3

How can include .asp file inside of html file and have it proccessed besides having to process all html files with asp.

A: 

I'm not totally sure what you're asking. If you're attempting to include a .asp file into a .html file, I don't believe it's possible. If you change your file's extension to .shtml, then you can put the following line into the HTML file:

<!--#include virtual="path to asp file/include-file.asp" -->

Now, whether or not the ASP would be parsed or the code will be displayed will have to be addressed by someone that understands server parsing better than me.

What would be a better solution is to just include an ASP file into another ASP file. If you want functionality like page-including, then giving your files .html or .shtml extensions will only make it harder to accomplish what you're trying.

Basically, use .asp for files that you want parsed and .html for files that can be served up to the user as-is.

Phantom Watson
Problem is that the site has many old html files that need the copyright year updated, the idea is to get this automated without having to jump through hoops of renaming files and links that link to them. They already link to a regular include file but that could only include static content.
Salt Packets
There is a way around this by making IIS parse html files as asp but that affects the performance of the server as all the files with include or not will have to be parsed, so I am trying to find a way around this.
Salt Packets
+1  A: 

you could use an IFRAME tag...but it's a bit sucky. I'd do what Phantom Watson says.

bchhun
I think this is probably best option at the moment.
Salt Packets
A: 

You can change executable extensions, so, if you want, you can make .html executable so that you could include file or do anything else.. Go to IIS manager (run->inetmgr), choose properties of your site, under tab 'Home directory' press 'Configuration..' You can add an extension there and an executable (you can insert the same as in the .asp)

But I don't think this is a best choise :) if it's exetutable, it should be .asp, if it's not - html