Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 03-02-2010
Member
 
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
Reply With Quote
  #2  
Old 03-02-2010
Member
 
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.!!
Reply With Quote
  #3  
Old 03-02-2010
Member
 
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
Reply With Quote
  #4  
Old 03-02-2010
Member
 
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.
Reply With Quote
  #5  
Old 03-02-2010
Member
 
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

%>
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Not able to Include files dynamically in ASP"
Thread Thread Starter Forum Replies Last Post
Adobe Dynamically-related files could not be resolved Deandre Windows Software 5 15-07-2010 03:26 AM
Dynamically-related files could not be resolved with Dreamweaver CS5 application Juan-Carlos Windows Software 5 15-07-2010 01:58 AM
Dynamically Loading External JavaScript and CSS Files Adrina_g Software Development 5 02-03-2010 11:36 AM
How to include files in PHP Samir_1 Guides & Tutorials 2 01-07-2009 11:39 AM
Batch file to delete files dynamically freelancer24 Windows Server Help 3 08-02-2009 02:33 AM


All times are GMT +5.5. The time now is 04:59 AM.