The short answer is "You can't conditionally include ASP code." And that answer remains unchanged.
However, you can conditionally include HTML or other non-ASP content. And you do it with some pretty simple ASP coding:
<% Set FSO = Server.CreateObject("Scripting.FileSystemObject") Set inFile = FSO.OpenTextFile( Server.MapPath( "nameOfFileToInclude.html" ) ) Response.Write inFile.ReadAll inFile.Close Set inFile = nothing %>
Do you see it? We use the FileSystemObject and simply open the file we need (the name of which could be dynamically generated or could come from a form field or or or). Then we write the entire contents of the file out to the generated Response stream in one statement! Dirt simple. Clean. And reasonably fast.
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.