Help needed

  • Thread starter Thread starter John Wes
  • Start date Start date
J

John Wes

Hi!

I'm using Obout SlideMenu Pro NET component in my site. To generate the menu
I just add following code and everythin is OK. But now I would like to
generate menu dynamicaly using data from MS Access db.

Here's my database structure:

CatID | CatName ParCatID
--------------------------------
1 |Company Home |
2 |Entertainment |1
3 |Games |1
4 |Greeting Cards |1
.............

Code:

Dim oSM As New obout_SlideMenu_Pro_NET.MenuPro()
oSM.Width = 160
oSM.Style_Path = "smi/styles/03.css"
' AddParent has parameters: Text, , [Height], [id]
oSM.AddParent("Company Home")
' AddChils has parameters: Text, [URL], [bShowImage] [id]
oSM.AddChild("Entertainment", "vb_pro_4.aspx", False, "en")
oSM.AddChild("Games", "vb_pro_4.aspx", False, "gm")
oSM.AddChild("Greeting Cards", "vb_pro_4.aspx", False, "gc")
oSM.AddChild("Downloads", "vb_pro_4.aspx", False, "dn")
oSM.AddChild("New Cars", "vb_pro_4.aspx", False, "nc")
oSM.AddChild("Used Vehicles", "vb_pro_4.aspx", False, "uv")
oSM.AddChild("Smart Stuff", "vb_pro_4.aspx", False, "ss")
' ......
lblMenu.Text = oSM.HTML()

I tried something like this, but in this case I can add only main
categories.

If MyDataReader(2).ToString() = Nothing Then
oSM.AddParent(MyDataReader(1).ToString())
End If

Could someone help me to get this work correctly!?

Thank You!
John Wes
 
Hi Wes,
I don't understand this completely, but I think that is not important to
help you.
Why don't you read your access data just in 3 arrays and fill it from that?
Than you can do it exactly the same as if it was text.
Maybe you think that is extra code, can be but it will become more
maintainable too.
I hope this helps a little bit.
Cor
 
Back
Top