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
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