R
RN1
The book I am referring to learn ASP states the following about server-
side includes:
==============================================
The code in a server-side include file is inserted into the pages that
use it BEFORE the page's ASP code is evaluated. This means that you
can put ASP code inside the include file, and it will be executed like
it was part of the page that includes it. On the other hand, it means
that you cannot use ASP to determine which page to include.
==============================================
But as opposed to the last line in the above para, the following code
makes use of ASP to determine which page to include:
<%
Dim intA,intB
intA=5
intB=6
If(intA>intB) Then
%>
<!-- #include file="File1.inc"-->
<%
Else
%>
<!-- #include file="File2.inc"-->
<%
End If
%>
File1.inc has only one line - This is File1.
Similarly, File2.inc also has only one line - This is File2.
Now since the If condition in the above code evaluates to False,
File2.inc gets included & hence the browser displays
This is File2.
But if I change the value of intA to, say, 10, so that the If
condition evaluates to True, then File1.inc gets included &
consequently the browser displays
This is File1.
So isn't the last line in the above para which I cited from the ASP
book wrong?
side includes:
==============================================
The code in a server-side include file is inserted into the pages that
use it BEFORE the page's ASP code is evaluated. This means that you
can put ASP code inside the include file, and it will be executed like
it was part of the page that includes it. On the other hand, it means
that you cannot use ASP to determine which page to include.
==============================================
But as opposed to the last line in the above para, the following code
makes use of ASP to determine which page to include:
<%
Dim intA,intB
intA=5
intB=6
If(intA>intB) Then
%>
<!-- #include file="File1.inc"-->
<%
Else
%>
<!-- #include file="File2.inc"-->
<%
End If
%>
File1.inc has only one line - This is File1.
Similarly, File2.inc also has only one line - This is File2.
Now since the If condition in the above code evaluates to False,
File2.inc gets included & hence the browser displays
This is File2.
But if I change the value of intA to, say, 10, so that the If
condition evaluates to True, then File1.inc gets included &
consequently the browser displays
This is File1.
So isn't the last line in the above para which I cited from the ASP
book wrong?