473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

cant get #include to work in .asp file.

I'm new to html and web coding, this is a simple one -
appreciate your help!

I'm attempting to get my browser bar links to reside in a
single .asp file to avoid multiple additions to pages
when I add a page to the site. I've done a lot of
reading and surfing, believe I know how to do it, but
can't get it to work.

I've installed IIS on my machine running XP pro, and have
created two .asp files, one called default.asp, the other
navigation.asp

both pages browse OK separately, but the navigation page
text does not appear within the default page at all (like
it's not getting "called" - here's the cut down code.

<html>
<head>
<title></title>
</head>

<body>
<% %>
<p>
This is the default page (filename default.asp)
<p>
<!- #include file="navigation.asp"->

</body>
</html>

-----------------

<html>
<head>
<title></title>

</head>
<body>
<% %>
This is the browser page (filename navigation.asp)

</body>
</html>
------------------
Thanks for your assistance
Regards
Greg
Jul 19 '05 #1
2 2129
Hi Greg,

Includes are done as:

<!-- #include file="navigation.asp" -->

Notice it's two dashes on either end, not one.

Also, if you are going to use this include for navigation, you may want to
do a virtual include as such:

<!-- #include virtual="/navigation.asp" -->

Doing a virtual include with the leading / will make it so that include is
always looked for from the root of your site. So, whether you have an asp
page in the root of your site, in a subdirectory, or in a directory 15
levels down, it you won't have to change your include directive in any of
them. If you do a file include, you'd wind up with an include like:

<!-- #include file="../../../../../../../../../../../../navigation.asp" -->

if you were a bunch of directories down.

Ray at home

"Greg" <el**********@bigpond.com> wrote in message
news:21*****************************@phx.gbl...
I'm new to html and web coding, this is a simple one -
appreciate your help!

I'm attempting to get my browser bar links to reside in a
single .asp file to avoid multiple additions to pages
when I add a page to the site. I've done a lot of
reading and surfing, believe I know how to do it, but
can't get it to work.

I've installed IIS on my machine running XP pro, and have
created two .asp files, one called default.asp, the other
navigation.asp

both pages browse OK separately, but the navigation page
text does not appear within the default page at all (like
it's not getting "called" - here's the cut down code.

<html>
<head>
<title></title>
</head>

<body>
<% %>
<p>
This is the default page (filename default.asp)
<p>
<!- #include file="navigation.asp"->

</body>
</html>

-----------------

<html>
<head>
<title></title>

</head>
<body>
<% %>
This is the browser page (filename navigation.asp)

</body>
</html>
------------------
Thanks for your assistance
Regards
Greg

Jul 19 '05 #2
Remember that the include file is literally pulled out and plunked in your
page. So you won't need all those html tags.
"Greg" <el**********@bigpond.com> wrote in message
news:21*****************************@phx.gbl...
I'm new to html and web coding, this is a simple one -
appreciate your help!

I'm attempting to get my browser bar links to reside in a
single .asp file to avoid multiple additions to pages
when I add a page to the site. I've done a lot of
reading and surfing, believe I know how to do it, but
can't get it to work.

I've installed IIS on my machine running XP pro, and have
created two .asp files, one called default.asp, the other
navigation.asp

both pages browse OK separately, but the navigation page
text does not appear within the default page at all (like
it's not getting "called" - here's the cut down code.

<html>
<head>
<title></title>
</head>

<body>
<% %>
<p>
This is the default page (filename default.asp)
<p>
<!- #include file="navigation.asp"->

</body>
</html>

-----------------

<html>
<head>
<title></title>

</head>
<body>
<% %>
This is the browser page (filename navigation.asp)

</body>
</html>
------------------
Thanks for your assistance
Regards
Greg

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Fozya | last post by:
Hi, I have problems compiling some code that perfectly runs in VS.Net in the G++. Here is what I got: MyClass a; MyClass b; //assign values to a and b .......
0
by: shan | last post by:
#include<fstream> #include<iostream> #include<string> #include<iomanip> #include<stdlib.h> #include<conio.h> #include<stdio.h> using namespace std; class library
5
by: David Mathog | last post by:
One thing that can make porting C code from one platform to another miserable is #include. In particular, the need to either place the path to an included file within the #include statement or to...
1
by: John | last post by:
Dear, We have 2 IIS server on win2000. we use the web server for upload file from server1 IIS to server2 IIS. We can connect from IIS1 to IIS2 success but the file unable to upload with below...
2
by: cv87cv | last post by:
I am trying to answer a question with regards to entering a set of numbers and text, and then I have got to search for a number and the text with it. I wish to enter the name on one line and the...
9
by: G123456 | last post by:
I am using Microsoft Visual Studio 2005 Prof. I am (only) using the C++ part of it (or i think so). When i am compiling my code i get the error "error C2653: 'std' : is not a class or namespace...
5
by: johnwebster9865 | last post by:
Hi This may be easy to most of you, but as a newbiw; I'm struggling. I am bringing in an include into a php file, but cant run the commands within the include. As an example, Within my php...
5
by: chevon1920 | last post by:
I am trying to do my assignment but I cant figure out how to get 8 data points per line to print to a file. Here is the assignment 1. Program asks the user to enter an odd number as a BASE,...
8
by: Huma123 | last post by:
Hi! My problem is that i cant able to run a simple c program cause of this error... Unable to open include file 'stdio.h' unable to open include file 'conio.h' while these header files r...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.