M
Mr Newbie
I have written a Custom Control Menu. Its fairly simple but it works well
enough. In order to simplify things I decided to store the Menu1 custom
control in Session. In the page load event below, it retreives the Menu
from session and assigns its reference to Menu1.
Within the Page_Load event I can see its internal values which have been
retreived for each menu item and so it looks good. However, when the Render
method is called of Menu1, everything seems to have disapeared, there are no
menuitems and the count is zero.
Im sure I am doing something fundamentally stupid, but I cant see it for
staring !
Does anyone have a clue ?
'Check is this is already in Session
If (Session("Menu") Is Nothing) Then
'Build the menu
Menu1.Add(New TONEControls.Menu.MenuItem("MItem", "default.aspx", "Home",
False, True))
Menu1.Add(New TONEControls.Menu.MenuItem("MItem", "CreateExpenses.aspx",
"New Expenses", False, False))
Menu1.Add(New TONEControls.Menu.MenuItem("MItem", "Review.aspx", "Review",
False, False))
'Add it
Session("Menu") = Menu1
Else
'Get it from session
Menu1 = Session("Menu")
End If
Menu1.SetSelected(0)
enough. In order to simplify things I decided to store the Menu1 custom
control in Session. In the page load event below, it retreives the Menu
from session and assigns its reference to Menu1.
Within the Page_Load event I can see its internal values which have been
retreived for each menu item and so it looks good. However, when the Render
method is called of Menu1, everything seems to have disapeared, there are no
menuitems and the count is zero.
Im sure I am doing something fundamentally stupid, but I cant see it for
staring !
Does anyone have a clue ?
'Check is this is already in Session
If (Session("Menu") Is Nothing) Then
'Build the menu
Menu1.Add(New TONEControls.Menu.MenuItem("MItem", "default.aspx", "Home",
False, True))
Menu1.Add(New TONEControls.Menu.MenuItem("MItem", "CreateExpenses.aspx",
"New Expenses", False, False))
Menu1.Add(New TONEControls.Menu.MenuItem("MItem", "Review.aspx", "Review",
False, False))
'Add it
Session("Menu") = Menu1
Else
'Get it from session
Menu1 = Session("Menu")
End If
Menu1.SetSelected(0)