I have 3 files. One is main.asp, the other two are .vbs files with runat=server. These two files both have the same routines with different content. For example:
Main.asp declares a variable "Variable1".
Script1.vbs -
<script language="VBScript runat=server>
Function SetVariableText()
Variable1 = "Script1text"
End Function
</script>
Script2.vbs -
<script language="VBScript" runat=server>
Function SetVariableText()
Variable1 = "Script2Text"
End Function
</script>
Now, in main.asp I try this:
If a = b then
<!--#INCLUDE FILE="script1.vbs"-->
else
<!--#INCLUDE FILE="script2.vbs"-->
end if
Even if a=b, Variable1 always equals "Script2Text".
I realize that Server.execute would remedy this but unfortunately there are other routines in the script file that main.asp will need later so Server.execute is out of the question for me. I assume this is happening because the script runs on the server and it is being executed instead of just loaded hence the last variable to be set is what i see. Does anyone know a way around this, or know where to find documentation on this?
thanks.
Main.asp declares a variable "Variable1".
Script1.vbs -
<script language="VBScript runat=server>
Function SetVariableText()
Variable1 = "Script1text"
End Function
</script>
Script2.vbs -
<script language="VBScript" runat=server>
Function SetVariableText()
Variable1 = "Script2Text"
End Function
</script>
Now, in main.asp I try this:
If a = b then
<!--#INCLUDE FILE="script1.vbs"-->
else
<!--#INCLUDE FILE="script2.vbs"-->
end if
Even if a=b, Variable1 always equals "Script2Text".
I realize that Server.execute would remedy this but unfortunately there are other routines in the script file that main.asp will need later so Server.execute is out of the question for me. I assume this is happening because the script runs on the server and it is being executed instead of just loaded hence the last variable to be set is what i see. Does anyone know a way around this, or know where to find documentation on this?
thanks.