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="HardwareOrder.aspx.vb"
Inherits="HI_HO.HardwareOrder" SmartNavigation="True" %>
<%@ Register TagPrefix="uc" TagName="Header"
Src="UserControls/Header.ascx" %>
(...)
<html>
<body>
<FORM id="frmHardwareOrder" method="post" runat="server">
<uc:Header id="ucHeader" runat="server"></uc:Header>
(...)
User control :
<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="Header.ascx.vb" Inherits="HI_HO.Header"
TargetSchema="http://schemas.microsoft.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.aspx" -->
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="#111111"
width="621" height="92" id="AutoNumber1">
<tr>
<td width="621" height="25" colspan="3"><!--
#includevirtual="header.aspx" --></td>
</tr>
<tr>
<td width="63" height="42"><!--#include
virtual="menu.aspx" --></td>
<td width="511" height="42"><!--#include
virtual="datapage.aspx" --></td>
<td width="40" height="42"><!--#include
virtual="left.aspx" --></td>
</tr>
<tr>
<td width="621" height="19" colspan="3"><!--
#includevirtual="footer.aspx" --></td>
</tr>
</table>
Any Ideas ?
.