1) i have 2 tabs Categories and SubCategories on db with relation 1 to many (im using entity framework)
2) i have to create a vertical menu like this
<ul>
<li>category 1
<ul>
<li>subcategory 1</li>
<li>subcategory 2</li>
<li>subcategory 3</li>
</ul>
</li>
</ul>
i think that my problem is here in my function
Function List_category_subcategory() As List(Of WHAT HERE???????)
Using db As New DBTestEntities
Dim q = From cat In db.categories Join subcat In db.subcategories On cat.CategoryID Equals subcat.CategoryID _
Select New With {cat.CategoryName, subcat.SubCategoryName}
List_category_subcategory = WHAT HERE???????
End Using
End Function
because i dont know what function have to return (maybe a list collection)
After it on my view have to cycle everything
something like that
<ul>
<% For Each cat In ??????%>
<li><a href="#"><%=Html.Encode(cat.CategoryName)%></a>
<ul>
<% For Each subcat In ???????%>
<li><%=Html.Encode(subcat.SubCategoryName)%></li>
<% Next%>
</ul>
</li>
<% Next%>
</ul>