![]() |
|
|
+ Search |
![]()
|
Mar 12th, 2003 12:57
Chris White, Yves Goldberg,
to include 1 asp page in another use #include, e.g.
<!-- #include file="page2.asp -->
unfortunatly these includes are determined at compile time, so the line
<!-- #include file=Request.QueryString("page") -->
would not work as at compile time, the Request object is not available
to the compiler.
The only way around this is to use a select case statement in your
code, e.g.
<%
page = Request.QueryString("page")
select case page
case "page1"
<!-- #include file="page1.asp" -->
case "page2"
<!-- #include file="page2.asp" -->
case "page3"
<!-- #include file="page3.asp" -->
case else
<!-- #include file="page4.asp" -->
end select
%>
Note this method is no different than just having all the code from
pages 1-4 pasted in between the case statements, and will not save any
compile time of the ASP page.
© 1999-2004 Synop Pty Ltd