473,569 Members | 3,063 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Include files

in normal asp , and even php i could use the
<!--#include file="login.asp x" -->
or
<!--#include virtual="login. aspx" -->

to include pages in my main page without using frames!

when i try this with my aspx page's i get the following
error!
There can be only one 'page' directive

How do I fix this without changing the other pages
functionallity/ design and code behind!

I need the following for example:

<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#1 11111"
width="621" height="92" id="AutoNumber1 ">
<tr>
<td width="621" height="25" colspan="3"><!--#include
virtual="header .aspx" --></td>
</tr>
<tr>
<td width="63" height="42"><!--#include
virtual="menu.a spx" --></td>
<td width="511" height="42"><!--#include
virtual="datapa ge.aspx" --></td>
<td width="40" height="42"><!--#include
virtual="left.a spx" --></td>
</tr>
<tr>
<td width="621" height="19" colspan="3"><!--#include
virtual="footer .aspx" --></td>
</tr>
</table>

Any Ideas ?
Nov 17 '05 #1
2 3101
In ASP.Net we use user controls

I have run out of time to show you an eg but will post again tomorrow if you
still don't have an answer

Cheers

Jody

"Kraai" <jo***@hr-focus.com> wrote in message
news:09******** *************** *****@phx.gbl.. .
in normal asp , and even php i could use the
<!--#include file="login.asp x" -->
or
<!--#include virtual="login. aspx" -->

to include pages in my main page without using frames!

when i try this with my aspx page's i get the following
error!
There can be only one 'page' directive

How do I fix this without changing the other pages
functionallity/ design and code behind!

I need the following for example:

<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#1 11111"
width="621" height="92" id="AutoNumber1 ">
<tr>
<td width="621" height="25" colspan="3"><!--#include
virtual="header .aspx" --></td>
</tr>
<tr>
<td width="63" height="42"><!--#include
virtual="menu.a spx" --></td>
<td width="511" height="42"><!--#include
virtual="datapa ge.aspx" --></td>
<td width="40" height="42"><!--#include
virtual="left.a spx" --></td>
</tr>
<tr>
<td width="621" height="19" colspan="3"><!--#include
virtual="footer .aspx" --></td>
</tr>
</table>

Any Ideas ?

Nov 17 '05 #2
Hi,

includes still work in ASP but, as the error message
says, there can only page directive.

The "page directive" is the "@Page" line at the top of
the page (with a yellow background in VS.Net)

One "conceptual way" of seeing it (although not very
technical) is that by adding an include, all included
pages form on "stream" (of HTML?) and that "stream" can
only have on @Page statement.

If you want to use UserControls, as previously suggested,
check out this article - to get you started ! :

http://msdn.microsoft.com/msdnmag/is...08/cutting/def
ault.aspx

Here's one of my example :

Main page :

<%@ Page Language="vb" AutoEventWireup ="false"
Codebehind="Har dwareOrder.aspx .vb"
Inherits="HI_HO .HardwareOrder" SmartNavigation ="True" %>

<%@ Register TagPrefix="uc" TagName="Header "
Src="UserContro ls/Header.ascx" %>

(...)
<html>
<body>
<FORM id="frmHardware Order" method="post" runat="server">
<uc:Header id="ucHeader" runat="server"> </uc:Header>

(...)

User control :

<%@ Control Language="vb" AutoEventWireup ="false"
Codebehind="Hea der.ascx.vb" Inherits="HI_HO .Header"
TargetSchema="h ttp://schemas.microso ft.com/intellisense/ie
5" %>

NO FORM TAG (<FORM>)

(...)

Hope this helps !

Ben
-----Original Message-----
in normal asp , and even php i could use the
<!--#include file="login.asp x" -->
or
<!--#include virtual="login. aspx" -->

to include pages in my main page without using frames!

when i try this with my aspx page's i get the following
error!
There can be only one 'page' directive

How do I fix this without changing the other pages
functionalli ty/ design and code behind!

I need the following for example:

<table border="1" cellpadding="0" cellspacing="0"
style="borde r-collapse: collapse" bordercolor="#1 11111"
width="621" height="92" id="AutoNumber1 ">
<tr>
<td width="621" height="25" colspan="3"><!-- #includevirtual="heade r.aspx" --></td>
</tr>
<tr>
<td width="63" height="42"><!--#include
virtual="menu. aspx" --></td>
<td width="511" height="42"><!--#include
virtual="datap age.aspx" --></td>
<td width="40" height="42"><!--#include
virtual="left. aspx" --></td>
</tr>
<tr>
<td width="621" height="19" colspan="3"><!-- #includevirtual="foote r.aspx" --></td>
</tr>
</table>

Any Ideas ?
.

Nov 17 '05 #3

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

Similar topics

7
3280
by: Chad Scharf | last post by:
I have a legacy ASP application running on IIS 6.0 (Windows Server 2003 Web Edition) that is throwing an error when processesing a certain asp page that has about 200 or so include directives. We've checked the spelling, paths, include directives, and files individually and all of them work. We have also commented out random ones (4 or so...
0
6100
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug file as folows. I need help to resolve them ASAP: cl /c /nologo /MDd /W3 /Od /GR /GM /Zi /GX /D "_DEBUG" /D " WIN32" /D "_W INDOWS" /D "_WINDLL"...
7
3540
by: mescaline | last post by:
Hi, Suppose a_file.cpp contains a function a_function() Now to include it in main_file.cpp I just do #include "a_file.cpp" and I'm all set. i recently came across this seemingly roundabout way to do this in 3 steps: 1. Add in main_file.cpp
6
9571
by: atv | last post by:
Alright, i have some questions concerning include files en global variables.I hope someone is willing to answer these. 1).Why is it that if i define a global variable in a file, say main.c, and i have also other functions defined in that file, i can use the global in all functions, but once i split up the rest of the function in other...
5
2499
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 very carefully define the order in which paths are searched with command line options on the compiler. Both can cause problems, especially when...
1
7462
by: Minh | last post by:
I've just installed VS.NET 2003 on my Athlon XP 1800+. However I couldn't get any project with STL includes to compile even if I create a new empty project (and added #include <string>). It gave me a bunch of "missing ;" errors. I did reinstall the whole thing a few times but it didn't work. Anyone have any idea? Thanks c:\Program...
1
4558
by: ya man | last post by:
when i use #include <iostream.h> in some files i get lots of error messages of the kind 'ambiguous symbol this is solved when i use #include <iostream why is that ? and can i use #include <iostream.h> in some way examples to the error messages c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\streamb.h(90): error C2872: 'ios' :...
9
4033
by: chat | last post by:
Hi, every body. I have 3 files like this: -------------------------------------------------------- file name : header.h #ifndef TEST_H #define TEST_H int a=1; double b=0.5;
2
3517
by: key9 | last post by:
Hi all look at the organize tree main.c ------ #include lib_adapter.c main() { foo();
16
2366
by: Chris Shearer Cooper | last post by:
In our Visual Studio 2005 application, we have several of our application's H files that are #included into stdafx.h. What is odd, is that when we change those application H files, VS2005 doesn't trigger a rebuild of the entire app (or of anything, for that matter). Is this a setting somewhere? Thanks!
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7619
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7930
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7983
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.