Results 1 to 5 of 5

Thread: Not able to Include files dynamically in ASP

  1. #1
    Join Date
    Jul 2006
    Posts
    273

    Not able to Include files dynamically in ASP

    Hi friends,
    I have the coding for the basic programs in ASP. I am getting an error while I am trying to include files dynamically. I have tried to do many things but still no success. I don't know where exactly I am going wrong.! Can anyone tell me that what should I do for this?? Is there any other way to include the files dynamically.?? Please help me to sort out this problem.
    (\__/)
    (='.'=) This is Bunny. Copy and paste bunny into your
    (")_(") signatureto help him gain world domination

  2. #2
    Join Date
    Nov 2008
    Posts
    1,192

    Re: Not able to Include files dynamically in ASP

    I think that it would be better for me (and others), to explain to you if you provide the sample of your coding. Since I don't know in what way you are using the coding for including files dynamically, there are chances that you are doing it that in wrong way or maybe you are missing something. I can help you only if you can provide the sample of your coding.!! Hope that you will post your coding soon for the sooner response.!!

  3. #3
    Join Date
    Jul 2006
    Posts
    273

    Re: Not able to Include files dynamically in ASP

    Extremely Thanks 'void' for responding me instantly. Even now I am thinking that there should be something wrong with my coding. The following is sample of my coding :
    Code:
    <% If case=1 then%>
    
        <!--include file="filetrial.asp"-->
    
    else
    
        <!--include file="filetrial.asp"-->
    
    End if %>
    Expecting that you will help me further.!!
    (\__/)
    (='.'=) This is Bunny. Copy and paste bunny into your
    (")_(") signatureto help him gain world domination

  4. #4
    Join Date
    Mar 2008
    Posts
    672

    Re: Not able to Include files dynamically in ASP

    The common mistakes that the beginner make are that they use some tags of HTML in that. For your knowledge, I would like you to tell that the following tags should not be used in your include files :
    Code:
    <html> 
    <head>
    </head>
    <body>
    </body>
    </html>
    If you use these tags you will get some errors.

  5. #5
    Join Date
    Nov 2008
    Posts
    1,192

    Re: Not able to Include files dynamically in ASP

    I guessed right about your coding. The way that you mentioned your coding for including the files dynamically in ASP is wrong. You cannot use that way for including files dynamically in ASP. First of all you will need to use FileSystemObject to achieve this. The following code may help you :
    Code:
    <%
    
        Dim objFS,otf
        Set objFS = CreateObject("Scripting.FileSystemObject")
        Set otf = objFS.OpenTextFile(server.mappath("/include/filename.asp"), 1, False)
        response.write otf.readall
        otf.Close
        set fs=nothing
    
    %>

Similar Threads

  1. Adobe Dynamically-related files could not be resolved
    By Deandre in forum Windows Software
    Replies: 5
    Last Post: 15-07-2010, 03:26 AM
  2. Replies: 5
    Last Post: 15-07-2010, 01:58 AM
  3. Dynamically Loading External JavaScript and CSS Files
    By Adrina_g in forum Software Development
    Replies: 5
    Last Post: 02-03-2010, 11:36 AM
  4. How to include files in PHP
    By Samir_1 in forum Guides & Tutorials
    Replies: 2
    Last Post: 01-07-2009, 11:39 AM
  5. Batch file to delete files dynamically
    By freelancer24 in forum Windows Server Help
    Replies: 3
    Last Post: 08-02-2009, 02:33 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,623,274.29360 seconds with 17 queries