problem with includes in asp
I Love Doing Websites Jun 11, 2009 3:30 PMHello,
I have an include file at the bottom of mypage, this is to list the categories of products.
At the same time I want to have a include in the main content of my page,
the problem is when I use both includes, I have an error saying
Active Server Pages error 'ASP 0141'
Page Command Repeated
/web/ildwnew/asppages/webdesigncategories.asp, line 1
The @ command can only be used once within the Active Server Page.
these are the codes for the includes:
for the webdesigncategories.asp
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/webdesignportofolio.asp" -->
<%
Dim rsCategories
Dim rsCategories_cmd
Dim rsCategories_numRows
Set rsCategories_cmd = Server.CreateObject ("ADODB.Command")
rsCategories_cmd.ActiveConnection = MM_webdesignportofolio_STRING
rsCategories_cmd.CommandText = "SELECT sectionID, sectionName FROM sections ORDER BY sectionName ASC"
rsCategories_cmd.Prepared = true
Set rsCategories = rsCategories_cmd.Execute
rsCategories_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
rsCategories_numRows = rsCategories_numRows + Repeat1__numRows
%>
<ul>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsCategories.EOF))
%>
<li><a href="houstonwebdesign/houstonwebdesigncompany_portfolio.asp?webdesigncategory=<%=(rsCate gories.Fields.Item("sectionID").Value)%>"><%=(rsCategories.Fields.Item("sectionName").Valu e)%></a></li>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsCategories.MoveNext()
Wend
%>
</ul>
<%
rsCategories.Close()
Set rsCategories = Nothing
%>
for the websites.asp include
<!--#include file="../Connections/webdesignportofolio.asp" -->
<%
Dim rs_websites
Dim rs_websites_cmd
Dim rs_websites_numRows
Set rs_websites_cmd = Server.CreateObject ("ADODB.Command")
rs_websites_cmd.ActiveConnection = MM_webdesignportofolio_STRING
rs_websites_cmd.CommandText = "SELECT pDescription, pGiantImage, pID, pImage, pLargeImage, pName FROM products ORDER BY pID DESC"
rs_websites_cmd.Prepared = true
Set rs_websites = rs_websites_cmd.Execute
rs_websites_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
rs_websites_numRows = rs_websites_numRows + Repeat1__numRows
%>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<%
While ((Repeat1__numRows <> 0) AND (NOT rs_websites.EOF))
%>
<tr>
<th width="46%" scope="col"><em><img src="<%=(rs_websites.Fields.Item("pLargeImage").Value)%>" alt="Website" /></em></th>
<th width="54%" scope="col"><h3>Description</h3>
<p><%=(rs_websites.Fields.Item("pDescription").Value)%></p></th>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs_websites.MoveNext()
Wend
%>
<tr>
<th scope="row"><a href="#">Visit Website</a></th>
<td> </td>
</tr>
</table>
<%
rs_websites.Close()
Set rs_websites = Nothing
%>
Please help



