Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Dec 2005
    Posts
    702
    Thanks
    0
    Thanked 0 Times in 0 Posts

    May use include file inside a conditional

    May use include file inside a conditional
    <% ...
    if x>0 then %>
    <!-- #include file=111.asp /-->
    <% else %>
    <!-- #include file=222.asp /-->
    <% end if
    ...
    %>

    or for this I must use subprocedures ?

  • #2
    New Coder
    Join Date
    Jul 2007
    Location
    North Carolina, US
    Posts
    32
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I never could get that to work either, but you might want to try this instead.
    Code:
    <%
       If x > 0 then
          Server.Execute("111.asp")
       Else
          Server.Execute("222.asp")
       End If 
    %>

  • #3
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Yes, you can . Just remember to open and close the if statement with delimiters because the include file MUST be outside of the asp delimiters.


    Note an asp include looks like this
    <!-- #include FILE="../Includes/Adovbs.inc" -->


    There is NO closing /

    Also if you are going to use parent paths they must be turned on in IIS.


  •  

    Posting Permissions

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