473,408 Members | 1,966 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Clear Menu

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

Nov 19 '05 #1
3 1174
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

Nov 19 '05 #2
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" <No************@comcast.netNoSpamM>
wrote in message news:No************@comcast.netNoSpamM:
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


Nov 19 '05 #3

"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:uD**************@TK2MSFTNGP10.phx.gbl...
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" <No************@comcast.netNoSpamM>
wrote in message news:No************@comcast.netNoSpamM:

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
Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: william c | last post by:
Hello there, I'd like to use an unordered list of links as a left-hand menu a la the fairly recent article on a list apart. (see http://www.alistapart.com/stories/taminglists/) So I cut and...
4
by: Jack | last post by:
I finally discovered where all of the blue boxes in my IDE are coming from after, once again, accidently hitting "Mark All" in a Find in the Visual Studio.NET IDE. However, there is no "Unmark...
6
by: trope | last post by:
Does anyone have the code to clear all of the elements in a select menu? I've been having trouble with this following code: for (var i=0; i< 100; i++) document.addskill.cat2.options = null; ...
1
by: Michael A. Covington | last post by:
Is there a simple way to empty out the Paint delegate (which is a list of method calls) before adding something to it? I'm envision a large, casually designed, experimental program in which...
5
by: Davie | last post by:
I'm developing an application on the smartphone. To reduce the size of the application i'm using panels where appropriate instead of forms. As a result of the design, I need to have different...
0
by: dpierson | last post by:
I have just converted one of my applications from .Net 1.1 / VS2003 to ..Net 2.0 / VS2005. I'm now seeing some different behavior in my app. Here's a simple case description: Form 1: Stock...
25
by: Tim Zych | last post by:
Is there keystroke combination that will clear the command window in Visual Studio.Net? Or, is there a way for me to clear it in vb.net code, prior to my code running? Thanks.
1
by: Benson | last post by:
I have a MainMenu (MenuStrip) which will be loaded (dynamic by codes) after the program Login form. The first time run is ok. But when I close the MainMenu and go back to Login form, and then go to...
2
by: owl | last post by:
and here I thought I was going to finally be able to change the world AND contribute back to python with my amazing clear screen extension - but I can't get it to work. ;( Copying from...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.