I would set up something a bit different. You could use a database to hold the catagories and sub-catagories, which means you could then create another page to actually edit these or add new ones. I would set it up like so:
Table: Category
cat_id - autonumber or auto incrementing integer
cat_name - text field to hold the name
Table: SubCategory
sub_id - autonumber or auto incrementing integer
cat_id - category this belongs to
sub_name - text field to hold the name
Then the easiest way to use this would be in the submenu.asp page.
Code:
'1 create your database connection and execute a query
' "SELECT cat_name, sub_name FROM Category, SubCategory WHERE Category.cat_id = SubCategory.cat_id"
'
'2 then to display them simply: (pretend rs is our recordset
Dim curCat
rs.MoveFirst
Do Until rs.EOF
'if the cat from the recordset is different form the last one we looked at
If rs("cat_name") <> curCat Then
'if this is not the first cat to be displayed
If curCat <> "" Then
Response.Write "</div></div>" 'finish cat and sub divs
End if
Response.Write "<div class=""cat_box"">" & rs("cat_name") & "<div class=""sub_box"">"
curCat = rs("catName")
End If
Response.Write "<a href=""" & rs("cat_name") & "_" & rs("sub_name") & ".asp"">" & rs("sub_name") & "</a><br>"
rs.MoveNext
Loop
'finish last cat and sub divs
Response.Write "</div></div>"
Now I don't know what your javascript looks like for the menu, but the above might be a good place for you to start.
other additions would include a page that allowed you to add a new category, select a category from a drop down box and add or delete a category from it, etc.
You could also use the FileSystemObject to validate that the files exists as category_subcategory.asp before displaying the link so you know you won't be displaying dead links.
The reason I split it into two tables above is in case you want to add extra content on either level.
-Tarwn
01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048