Database Driven Menus

W

Winshent

I am trying to write a data driven menu. I am still a beginner so am
asking for advice.

My current method is to load all of the result into a html style
string using the following code:


############################
Public Function GetMenuList() As String
Do While myReader.Read()
strResult += Environment.NewLine
strResult += "<table class='CatMenu' ><tr><td
class='MenuCategory'>" & myReader("Category") & "</td></tr>" &
Environment.NewLine
strResult += GetSubCategories(CInt((myReader("CategoryID"))))
& "</table>" & Environment.NewLine
strResult += "<br />"
Loop
end function

Public Function GetSubCategories(ByVal CategoryID As Integer) As
String
load reader code etc..
Do While myReader.Read()
strResult += "<tr><td class='MenuSubCategory' ><a
class='SubCatText' href='http://www." & strDomainPath &
"?subcategory="
strResult += CStr(myReader("SubCategoryID"))
strResult += "' target='new'>" & myReader("SubCategory") &
"</a></td></tr>" & Environment.NewLine
Loop
End function

################################

the GetMenuList function populates a label which is referenced on my
aspx page..

I want to be able dynamically add a new category table to the page and
list all subcategories.. is there another way of doing this? i hate
dealing with html!

thanks

Vincent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top