? P...">

Why is the classic ASP backend included in the comment?

Why is the syntax for server side include <!--#include file="suchandsuch"-->

?

Placing semantically meaningful content inside a comment seems awkward and misleading - indeed, the first time I saw this syntax, I assumed it was a comment that was "commented out". What was the reason the language was designed to use this syntax as opposed to type alternatives <% #include file="suchandsuch" %>

?

(I know parsing this simple substitution alternative will display something like <% <% vbscript_stuff %> html_stuff %>

, but it should be trivial to parse it a little more intelligently to avoid misusing HTML comments.)

+3


source to share


2 answers


I think the main reason is that the server side processing in the case of inbound server assemblies is handled directly by IIS and then passed to the processing processor that the content belongs to.

So, using the example in the question, if the syntax was:

<% #include file="suchandsuch" %>

      

then it is directly related to the ASP processing syntax, which means that the SSI definition is no longer common to it.

As stated in the MSDN library documentation



This directive can be used on an ASP page, STM page, INC page, or any page with a filename extension that maps to an SSI interpreter (Ssinc.dll) or an ASP interpreter (Asp.dll). If you have IIS Manager installed, you can change the default application mappings and add new mappings.

Also, since the comment is <!-- -->

processed on the server side, it never reaches the client browser, so the HTML semantics are not affected.


useful links

+2


source


The server side (and their comment format) is not limited to ASP / IIS - it was used to enable the idea of ​​server side macros that would be processed by the server directly without rendering as text on the client.



Here's a helpful summary: http://en.wikibooks.org/wiki/Active_Server_Pages/Server-Side_Includes

+1


source







All Articles