|
-
Jun 28th, 2001, 12:03 AM
#1
Thread Starter
Fanatic Member
ASP - Populating Menu Link
I want to dynamically create my menus. To do this I am looping through a rs and placing a link and name in a table.
Here is the code
<html>
<title>Brian's Home Page</title>
<head>
<%
dim objRs, objConn, strSQL
set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\wwwroot\db\dbWebsite.mdb"
strSQL = "Select * from tblMenu"
set objRs = Server.CreateObject("ADODB.Recordset")
objRs.Open strSQL, objConn
%>
</head>
<body>
<table width="500" border="0" bgcolor="#006666">
<tr>
<td height="20" width="100"><a href="default.htm">Home</a> </td>
<td height="20" width="100"><a href="default.htm">Home</a> </td>
<td height="20" width="100"><a href="default.htm">Home</a> </td>
<td height="20" width="100"><a href="default.htm">Home</a> </td>
<td height="20" width="100"><a href="default.htm">Home</a> </td>
</tr>
</table>
<table border="0" width="60" bgcolor="#006666">
<tr>
<%
while not objrs.eof
response.write "<td><a href=>" & objRs("Link") & objrs("MenuItems") & "</a></td></tr>"
objRs.movenext
wend%>
</table>
</body>
</html>
The Link RS is the link and the MenuItems RS would be what I want to appear as the link to click on.....Instead it shows both entries as text and hyperlinks in the table...Any suggestions?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|