Dynaically including file at run-time

Results 1 to 2 of 2

Thread: Dynaically including file at run-time

  1. #1
    Join Date
    Dec 1969
    Posts
    745

    Default Dynaically including file at run-time

    Hi!<BR> I have seen a solution to this on the web somewhere, but at the time I thought I would never need it! How can I dynamically include a file within ASP? I cannot do it like this:<BR><BR>SELECT CASE(var)<BR> CASE 1<BR> &#060;!-- #include file="file1.asp" --&#062;<BR> CASE 2<BR> &#060;!-- #include file="file2.asp" --&#062;<BR> CASE 3<BR> &#060;!-- #include file="file3.asp" --&#062;<BR>END SELECT<BR><BR>I need to do something like this (although this won&#039t work):<BR><BR>&#060;!-- #include file="file&#060;%=Request("var")%&#062;.asp" --&#062;<BR><BR>Any thoughts, ideas, solutions?<BR><BR>Thanks,<BR>Michael.

  2. #2
    SantoshPradhan@yahoo.com Guest

    Default RE: Dynaically including file at run-time

    Include is a HTML command, you need to use that out side of ASP.<BR>Try following<BR>&#060;%<BR>SELECT CASE(var)<BR>CASE 1 %&#062;<BR>&#060;!-- #include file="file1.asp" --&#062;<BR>&#060;% CASE 2 %&#062;<BR>&#060;!-- #include file="file2.asp" --&#062;<BR>&#060;% CASE 3 %&#062;<BR>&#060;!-- #include file="file3.asp" --&#062;<BR>&#060;% END SELECT %&#062;<BR><BR>Hope this helps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •