Hello,
I want to include an ASP file into another ASP file without using the server side include. The reason why I am finding an alternative for the server side include is explained as follows:
file1.asp
*********
<%
If a > 10 Then
%>
<!--#include file="inc1.asp"-->
<%
Else
%>
<!--#include file="inc2.asp"-->
<%
End If
%>
inc1.asp
********
Dim x
x=10
Respose.Write (x)
inc2.asp
********
Dim x
x=20
Respose.Write (x)
When I run file1.asp it I get the following error:
Microsoft VBScript compilation (0x800A0411)
Name redefined
I know this happens since the variable x is DIM'med 2 times. Even though I include the inc1.asp and inc2.asp conditionally, they both are included prior to the ASP compilation (and the variable x get Dim'med twice). This is an ugly part of the server side include.
That's why I am trying to find a way to get around this problem.
Any helps will be greatly appreciated.
Thanks and regards,
Faheem Hameed
I want to include an ASP file into another ASP file without using the server side include. The reason why I am finding an alternative for the server side include is explained as follows:
file1.asp
*********
<%
If a > 10 Then
%>
<!--#include file="inc1.asp"-->
<%
Else
%>
<!--#include file="inc2.asp"-->
<%
End If
%>
inc1.asp
********
Dim x
x=10
Respose.Write (x)
inc2.asp
********
Dim x
x=20
Respose.Write (x)
When I run file1.asp it I get the following error:
Microsoft VBScript compilation (0x800A0411)
Name redefined
I know this happens since the variable x is DIM'med 2 times. Even though I include the inc1.asp and inc2.asp conditionally, they both are included prior to the ASP compilation (and the variable x get Dim'med twice). This is an ugly part of the server side include.
That's why I am trying to find a way to get around this problem.
Any helps will be greatly appreciated.
Thanks and regards,
Faheem Hameed