|
 |
asp_web_howto thread: creating a frameset using SSI
Message #1 by "flummi" <flummi@e...> on Mon, 1 Jul 2002 13:23:54
|
|
Hi,
I don't want to user HTML-framesets, so I created a frameset with Server
Side Includes. My main ASP page looks like this:
*********** default.asp page *************
...
<% On Error Goto 0 %>
...
<% if CONDITION1 then %>
<!--#include FILE="file1.inc.asp" -->
<% else if CONDITION2 then %>
<!--#include FILE="file2.inc.asp" -->
<% end if %>
...
******************************************
Using this method I can easily build a kind of frameset that includes
different frames depending on the conditions.
But since I am working in the 'on error goto 0' mode, I am getting the
problem, that variables defined in both included files are returning the
error 'variable redefined' in this ASP page. This happens because ASP
first replaces the include files (before executing the 'if then'
statement). I can avoid this problem only by defining the variables in
this ASP page or by setting 'on error resume next' - both solutions that i
don't really like :-/
So my question is: Is there a better way to build a kind of frameset
without using HTML-framesets?
Thanx for any help,
Flummi
Message #2 by "flummi" <flummi@e...> on Mon, 1 Jul 2002 13:24:38
|
|
Hello,
I don't want to user HTML-framesets, so I created a frameset with Server
Side Includes. My main ASP page looks like this:
*********** default.asp page *************
...
<% On Error Goto 0 %>
...
<% if CONDITION1 then %>
<!--#include FILE="file1.inc.asp" -->
<% else if CONDITION2 then %>
<!--#include FILE="file2.inc.asp" -->
<% end if %>
...
******************************************
Using this method I can easily build a kind of frameset that includes
different frames depending on the conditions.
But since I am working in the 'on error goto 0' mode, I am getting the
problem, that variables defined in both included files are returning the
error 'variable redefined' in this ASP page. This happens because ASP
first replaces the include files (before executing the 'if then'
statement). I can avoid this problem only by defining the variables in
this ASP page or by setting 'on error resume next' - both solutions that i
don't really like :-/
So my question is: Is there a better way to build a kind of frameset
without using HTML-framesets?
Thanx for any help,
Flummi
Message #3 by "Ken Schaefer" <ken@a...> on Tue, 2 Jul 2002 09:08:43 +1000
|
|
Change the code in your include files to be *routines* (ie functions and
subroutines)
Put the include files at the top of the page.
Call the routines as required:
<%
If blnCondition1 then
DoRoutine1()
Else
DoRoutine2()
End If
%>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "flummi" <flummi@e...>
Subject: [asp_web_howto] creating a frameset using SSI
: I don't want to user HTML-framesets, so I created a frameset with Server
: Side Includes. My main ASP page looks like this:
:
: *********** default.asp page *************
: ...
: <% On Error Goto 0 %>
: ...
: <% if CONDITION1 then %>
: <!--#include FILE="file1.inc.asp" -->
: <% else if CONDITION2 then %>
: <!--#include FILE="file2.inc.asp" -->
: <% end if %>
: ...
: ******************************************
:
: Using this method I can easily build a kind of frameset that includes
: different frames depending on the conditions.
:
: But since I am working in the 'on error goto 0' mode, I am getting the
: problem, that variables defined in both included files are returning the
: error 'variable redefined' in this ASP page. This happens because ASP
: first replaces the include files (before executing the 'if then'
: statement). I can avoid this problem only by defining the variables in
: this ASP page or by setting 'on error resume next' - both solutions that i
: don't really like :-/
:
: So my question is: Is there a better way to build a kind of frameset
: without using HTML-framesets?
:
: Thanx for any help,
: Flummi
|
|
 |