For some reason, I am having trouble with this. I want to have a select statement, such as -
<%
Select Case Request("service")
Case "s"
<!-- #include file="includes/bottom_nav.inc" -->
Case "p"
<!-- #include file="includes/bottom_nav.inc" -->
Case "a"
<!-- #include file="includes/bottom_nav.inc" -->
End Select
%>
I know that is not the correct syntax for the include files.
I have been avoiding this issue but it keeps popping up and I cannot figure out a solution. Include statements pathed two or more folders deep they break.
This works: <!--#include file="../includes/mo_security.asp" -->
This does not work: <!--#include file="../../includes/mo_security.asp" -->
So basically my site files are limited to one folder deep. Ex: ROOT/parentFolder/files.htm One I move another level down the includes do not work anymore: Ex: ROOT/parentFolder/childFolder/files.htm I am on a Windows IIS server. Is there any solution to this or is it just a limitation of the include statement?
I am using the ASP include statements for some HTML code, and I have the <body></body> tags included in an outside <!--#include--> file. Is this OK? Or could it mess something up not having the <body></body> tags in the actual page HTML?
I am still writting VBScript code and .asp pages for our Intranet. Recently I learned how to use include files from this site.
I was very successful using include statements as long as I put the include statement inside the subdirectory that contained the asp files I was using.
I would like to put the include files in the root or a seperate directory and be able to call them from a page tghat is in a different directory?
I use one of the first two if statements by themselves, and comment everything else out, the code works. But when I use more than one of these, i get a "page cannot be displayed" message.
I've also tried condensing if statements into ifelses. Same results. Anyone know why this would be happening? Code:
I have two ASP statements (<% , %>) that I would like to insert into one ASP file. One of the statements is already inserted in the file and works successfully. However, when I insert the second ASP statement, the page comes up with an error;-
"Microsoft VBScript compilation error '800a0411'
Name redefined "
I am pretty sure I get this error because both statements are conflicting with one another. I also can't combine the two statements as I use a DSN connection for one, and a DSN-less connection for another and I connect to 2 different databases.
How might I be able to include both ASP statements within the single ASP file?
A user on another Forum said " there is a variable DIMmed twice.
easiest way is a third include with the variable names in. That way it can be used with any combination of the includes."
i have many different variables like addr, addr1, addr2 addr3 etc and i want this to occur
if addr = "" then error = "ERROR:You have not entered all the required information. <br>Press the Back Button on your web browser and try again." Response.Write error
But that only works for addr. Is there any way to include addr2 and the rest of the variables in that statement without writing it out 50 times
I want to be to call my menu from another file onto my page so that i dont have to add it to every page of my website. The problem is when i try to add it using the include method it says that only one include file is allowed on an ASP. The other include file is my connection string so i cant really take that out of the page because then nothing else will work!
How can i get the menu page included as well as the connecting string?
Have added the code below, i have highlighted the 2 include files that i want to use in blue, i have also left the div tag in for where i currently have the menu which is what i want to take out and have ther include file there instead, if that makes sense. Basically the bit in red i want to be able to remove from all of my pages and add the blue file above the red code in instead, but i dont know how!!!!! Code:
I have an asp page written entirely in jscript with a vbscript used as an include file which one variable on the page must access.
When the page runs, I run into jscript complilation errors when it tries to access the include file (since it is written in vbscript), and I can't figure out how to get the two to work together. How do you get both scripting languages to work on the same page?
I'm wondering if there's any way to include a XML file (with a XSL) in a ASP file? I've tried this <!--#include file="publications.xml"--> but the XML-code is included before it is formated according to the XSL and ends up being unformated.
I want to include files, a header and a footer to my asp page. The files i want to include its on another server, i can reach it with a www-url. Can i use the www-url to include the file to asp page?
How can I include a .cgi file in an .ASP file? I've tried #include, Server.Transfer, and Server.Execute (yes, I know the last two are only for ASP, but I tried it anyway). If I have to, I guess I'll use ASPHTTP to do an http call to the file but first I wanted to see if there was a more elegant way to do it Is there an efficient way to include the output of a .cgi file in an ASP file?
<% If rsResult.fields(3).value = "" Then Response.Write "No File Available</td>" Else %> <!-- #include file="Response.Write rsResult.fields(3).value" --> <% End If %>
I do almost exclusively ASP on IIS, so I'm stupid when it comes to dealing with flat HTML on Linux/Apache.I have a static site on a Linux box where I want to do an include on an ASP file on an IIS box, and can't make it work.
I've tried <!--#include virtual="http://where.com/abc.asp"--> and <!--#include virtual="http://where.com/abc.txt"-->
The ".txt" extension try was in case it's true what I heard that IIS won't let a remote server execute an ASP in an include file.
Also tried <!--#include file=...", even though I know from experience that Apache requires "virtual," not "file."
And also tried <!--#exec cgi=...".
NOT drawing any errors: the generated output just repeats the "<!--#include..." line instead of outputting results from the ASP file.
Trying to use a include file in an if statement and it is not working,I have tried it multiple ways and have keep getting errors or blank where it should be.
Code:
<% IF session("sessionID") = "" THEN Response.write (" <!--#INCLUDE file=""loginHeader.asp""--> ") ELSE Response.write (" <!--#INCLUDE file=""loggedinHeader.asp""--> ") END IF %>
How to include file into an ASP program? I was trying with this command:
<!-#include file="INC_file.asp" ->
but unfortunately it does not work but isn't any error message.IIS server shows primary site,but without informations from incuded file.How can I make it works?
The current html file has to 2 drop down boxes. Depending on the selection chosen, there is a predetermined html file to load.My new asp file will replace the current html that has the 2 drop down boxes and it has its own set of design and graphics. So depending on the selection chosen, instead of loading the predetermined html file, I need to grap a section of the contents in this predetermined html file and add it to the content section of my asp file dynamic.
See, another very customised app. creates this predetermined html file dynamically and I have no access to this. My work around is to get the main content I want from this html and include it in my asp file dynamically.
I'm trying to include file using <!-- #include file="abc.asp"--> and it works without any problem. but the problem is in if file name is in asp variable how should i write?
I have a few ASP pages within each ASP pages I have a block of Javascript that is different for each ASP page contained within the Javascript block is 20 lines that is same across the ASP pages. Is there any script I can enter that would include these lines from a text files or another ASP file?
I need to include an asp file from another server. Code:
<!--#include file="SicurezzaDip.asp"-->
I think that is the normal way to do it. I've also used the code shown below, but it doesn't seem to work..Is it possible to Include asp files from another server ? How can i do it ? Code:
I have a menu that I use as an include file. it's a horizontal menu that extends to show sub menus.
the table the menu is in has silver background. my problem is that when i use the page as a include file the background color for the menu expands to cover the whole page. is there an issue with the include files that would cause the table color to migrate to all the tables?
if any one knows another way i can use this menu as an include file and keep the background color from migrating it would be greatly appreciated.
I used to do a lot with asp and now I'm going to use asp.net technology In asp I had a file functions.asp with all my functions I used on several pages like generating connection to database, generating links on pages and things like that.
Than I had <!-- #include file="..includefunctions.asp"--> statement on each asp page, at the top of the page.
I would like to know, how is this in asp.net You use the same procedure or is there some other, better way to include functions? I read one book but I didn't found any instructions?
Is it possible to use the same include file on one ASP. Example, I have a logic for valid and invalid users but I'll use the same include file for both scenarios; the difference would only be the position where I'll display the include file in the code for example I want to display it on the top and the other at the bottom part?
Normally I include files that are in the same directory/folder as the calling file. How can I include a file that is in another directory? Let's say the file that I am trying to include resides at C:websiteHeader.asp . and the file that should contains the include file is reside at C:Source.asp. In source.asp, I will have to write "include file="header.asp"?