T
tshad
I am not sure why I am getting this error:
I have the following code I want to run from another include file that holds
all my functions.
functions.inc
************************************************************************************
<Script runat="Server">
Sub fnHeader(client As String)
response.write("<!-- #include file = ../includes/staffingHeaders.inc -->")
end function
function fnFooter(client As String)
response.write("<!-- #include file = ../includes/staffingFooters.inc -->")
end function
</script>
************************************************************************************
My pages would look something like:
*****************************************************************************
<!-- #include file = ../includes/functions.inc -->
<%@ Page Language="VB" AutoEventWireup="true" ContentType="text/html"
ResponseEncoding="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
....
<%
Call fnHeader("Richard")
%>
.... Code specific to this page
<%
Call fnFooter("Richard")
%>
....
</html>
******************************************************************************
The calls would put an include file at that point which has some generic
HTML code or ASP.NET code in it.
The problem is I get the following error:
*************************************************************************************
Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.
Parser Error Message: Server includes are not allowed in server script tags.
Source Error:
Line 1: <Script runat="Server">
Line 2: Sub fnHeader(client As String)
Line 3: response.write("<!-- #include file =
.../includes/staffingHeaders.inc -->")
Line 4: end function
Line 5:
Source File: c:\inetpub\wwwroot\development\includes\functions.inc Line:
3
******************************************************************
Why do I get this and is there a way to do what I want to do?
Thanks,
Tom.
I have the following code I want to run from another include file that holds
all my functions.
functions.inc
************************************************************************************
<Script runat="Server">
Sub fnHeader(client As String)
response.write("<!-- #include file = ../includes/staffingHeaders.inc -->")
end function
function fnFooter(client As String)
response.write("<!-- #include file = ../includes/staffingFooters.inc -->")
end function
</script>
************************************************************************************
My pages would look something like:
*****************************************************************************
<!-- #include file = ../includes/functions.inc -->
<%@ Page Language="VB" AutoEventWireup="true" ContentType="text/html"
ResponseEncoding="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
....
<%
Call fnHeader("Richard")
%>
.... Code specific to this page
<%
Call fnFooter("Richard")
%>
....
</html>
******************************************************************************
The calls would put an include file at that point which has some generic
HTML code or ASP.NET code in it.
The problem is I get the following error:
*************************************************************************************
Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.
Parser Error Message: Server includes are not allowed in server script tags.
Source Error:
Line 1: <Script runat="Server">
Line 2: Sub fnHeader(client As String)
Line 3: response.write("<!-- #include file =
.../includes/staffingHeaders.inc -->")
Line 4: end function
Line 5:
Source File: c:\inetpub\wwwroot\development\includes\functions.inc Line:
3
******************************************************************
Why do I get this and is there a way to do what I want to do?
Thanks,
Tom.