Clear Menu

  • Thread starter Thread starter Shapper
  • Start date Start date
S

Shapper

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
 
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!
***************************
 
Hi,

That's what I have. The problem is that somehow when I do BindMenu()
again the new items are added to the old items.

This is a bought component so I might need to do something else.

Thanks,
Miguel
 
Shapper said:
Hi,

That's what I have. The problem is that somehow when I do BindMenu()
again the new items are added to the old items.

This is a bought component so I might need to do something else.

Thanks,
Miguel

"Cowboy (Gregory A. Beamer) - MVP" <[email protected]>
wrote in message


I would think the component has a clear or initialize method that you can
call, but without seeing any code it is tough to say.
Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top