KCWebMonkey wrote:
the problem is that include files are ran before any other asp code, so you can't put an include file in an if statement.
|
You sure can put it on an If statement, what you can't do is put it inside a Response.Write. In that case the problem was that the script block was closed before closing the response.write...
The includes are not exactly ran before the asp code, many people think that but it's incorrect. The includes just can't be placed inside ASP code cuz they're not ASP and can't be used on Response.Write cuz they're not client side stuff that's why they're called server side includes (Response.Write just sends text to the browser).
As long as it's not inside a script block you can use it anywhere... What you can't do is include the same file or two files with the same variables on the same script cuz the server includes the files before executing any ASP so you'll get a variable redefined error... same as if you do this:
If strHuh = "Hello" Then
Dim intHuh
intHuh = 5
Else
Dim intHuh
intHuh = 1
End If
Even though the var is only gonna be defined once that would cause a variable redefined error...