1. Move the menu binding code to its own routine.
'Original like
Sub Page_Load()
If Not Page.IsPostback Then
'Code here
End If
End Sub
'To this
Sub Page_Load()
If Not Page.IsPostback Then
BindMenu()
End If
End Sub
Sub BindMenu()
'Code here
End Sub
2. You can then call that routine in events that have to change the menu
(like clicking a particular button?):
Sub Button1_Click()
BindMenu()
End Sub
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"Shapper" wrote:
Hello,
I have this code in my aspx file:
<div id="dmenu"><CAMenu:Menu id="myMenu"
runat="server"></CAMenu:Menu></div>
On my .aspx.vb file the menu is build in Page_Load.
At a certain time I need to clear the built menu and restart.
Basically I need to get back to:
<CAMenu:Menu id="myMenu" runat="server"></CAMenu:Menu>
How can I do this?
Thanks,
Miguel