Tuesday, September 1, 2009
Can I Buy Cole Slaw Dressing
We often happens have to include in our pages that repeat sections of the page to create a sort of omogeneicità site.
For example, a structure may be quite common:
\u0026lt;div id="testa"> \u0026lt;/ div> \u0026lt;div
id="menu"> \u0026lt;/ div> \u0026lt;div
id="corpo"> \u0026lt; ; / div> \u0026lt;div
id="piede"> \u0026lt;/ div>
and within each div the content is pasted with an include. There are two types of
include: include files and include virtual.
The two commands are exactly the same purpose, only that the include file has the limit to include only files that reside in the same directory (unless you sure this enabled the "parent paths" on your server, then you can refer to files in other directories using "../" instead of the folder name)
fact, if you try to insert a slash (/) before the name of the file will return error. The
include virtual however it is much more practical, allowing you to enter absolute preparatory courses (which I prefer to that for), and thus be able to use the include in any page of the site without bothering to change the path.
The syntax of include files and virtual is as follows:
\u0026lt;!--# include file = "tuofile.htm" ->
\u0026lt;!--# include virtual = "/ tuofile.htm" -> There
But sometimes the need to dynamically include files ... that is based on certain factors include a file over another. In the syntax of include
you can not insert variables to change dynamically, for example the name of the linked page.
One solution is to use the command Server.Execute.
The syntax is as usual the ASP, and inside I will be able to enter my variables:
\u0026lt;% Server.Execute "tuofile.htm"%>
obviously I can enter the variable with the usual syntax:
\u0026lt;% Server.Execute "" & & nomefiledinamico. "htm"%>
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment