One of the ways to dynamically include #include

Source: Internet
Author: User
Tags include
include| Dynamic If you want to dynamically process an ASP-critical file that is destined for a client, there are problems because the system handles #include before the server initializes the page. Therefore, the following code execution fails:
<!--fail code-->
<%myday=dayname ()%>
<!--#include file=<%=myday%>.asp-->
To solve this problem, you should include all the included files, and then in the server initialization page is to determine which file to include, to achieve the dynamic inclusion of the file, of course, this will cause
Large server overhead, examples are as follows:
<!--success Code>
<%myday=dayname ()%>
<%select Case Myday%>
<%case "Sunday"%>
<!--#include file= "rest.asp"-->
<%case else%>
<!--#include file= "work.asp"-->
<%end select%>
If we have any good way, hope to teach! :)



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.