473,322 Members | 1,379 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,322 software developers and data experts.

asp:menu problem

Hi guys,

I have a Menu component that I'm using the itens collection (via properties
menu) to populate (i'm not using any DataSource, or populating on the fly
using code).

my question is How can I disable some menus on the fly?

I already used

Protected Sub mainMenu_DataBinding(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim m As New MenuItem
For Each m In mainMenu.Items
Select Case m.Value.ToString.ToLower
Case "economy"
m.Enabled = False
End Select
Next
End Sub

with no luck at all, does anyone knows how to do this, so I can implement a
checkout feature for the User permissions and disable the menus that he/she
does not have access...
thank you.
--

Bruno Alexandre
København, Danmark

"a portuguese in Denmark"


Oct 3 '06 #1
2 1776
Have you tried putting the code in Form Load event?
--
Ameet Phadnis
Sr. Technical Consultant
e Tek Global Inc.
ASP Alliance Author Page: http://aspalliance.com/author.aspx?uId=44260
"Bruno Alexandre" wrote:
Hi guys,

I have a Menu component that I'm using the itens collection (via properties
menu) to populate (i'm not using any DataSource, or populating on the fly
using code).

my question is How can I disable some menus on the fly?

I already used

Protected Sub mainMenu_DataBinding(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim m As New MenuItem
For Each m In mainMenu.Items
Select Case m.Value.ToString.ToLower
Case "economy"
m.Enabled = False
End Select
Next
End Sub

with no luck at all, does anyone knows how to do this, so I can implement a
checkout feature for the User permissions and disable the menus that he/she
does not have access...
thank you.
--

Bruno Alexandre
København, Danmark

"a portuguese in Denmark"


Oct 3 '06 #2
as easy as that :-)

I always thought about Menu like GridView :-)
thank you.

--

Bruno Alexandre
København, Danmark

"a portuguese in Denmark"
"Ameet Phadnis(e Tek Global Inc.)"
<Am***********************@discussions.microsoft.c omescreveu na mensagem
news:3E**********************************@microsof t.com...
Have you tried putting the code in Form Load event?
--
Ameet Phadnis
Sr. Technical Consultant
e Tek Global Inc.
ASP Alliance Author Page: http://aspalliance.com/author.aspx?uId=44260
"Bruno Alexandre" wrote:
>Hi guys,

I have a Menu component that I'm using the itens collection (via
properties
menu) to populate (i'm not using any DataSource, or populating on the fly
using code).

my question is How can I disable some menus on the fly?

I already used

Protected Sub mainMenu_DataBinding(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim m As New MenuItem
For Each m In mainMenu.Items
Select Case m.Value.ToString.ToLower
Case "economy"
m.Enabled = False
End Select
Next
End Sub

with no luck at all, does anyone knows how to do this, so I can implement
a
checkout feature for the User permissions and disable the menus that
he/she
does not have access...
thank you.
--

Bruno Alexandre
København, Danmark

"a portuguese in Denmark"



Oct 3 '06 #3

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

Similar topics

2
by: Uriah | last post by:
I have a sort of critical problem that is driving users nuts. My site works fine when running over HTTP but when I switch to HTTPS, an error is generated every time a user mouses over one of the...
7
by: Chuck Hartman | last post by:
I have a Windows service that requests web pages from a site using an HttpWebRequest object. When I try to request a page from an ASP.NET 2 site, I get a WebException with message "The remote...
7
by: tfsmag | last post by:
Has anyone had a problem with putting a menu control into a master page in .net 2.0? I have a problem where if i just drop a menu control on a regular page the menu works fine, the submenus work...
1
by: Mark Rae | last post by:
Hi, Sorry for the repost - my ISP is having huge usenet problems at the moment... Following on with the problems of asp:Menu controls and Safari, I found the following article:...
2
by: jason | last post by:
Does anybody know how I would get borders around each menuitem? Do I have incorportate into a table? Thanks. The below produces a border around the entire menu. <form id="form1" runat="server">...
2
by: Kevin L. Kitchens | last post by:
Howdy... Been toying the the asp:menu object in order to dump the manually generated menu I've been using, however, I cannot seem to get the coloring to work properly. First off, what CSS...
1
by: sthrudel | last post by:
Hello! I'm programmatically inserting a navigation asp menu to a page, like this: // Create new Menu Menu menu = new Menu(); // Create new MenuItem MenuItem mainItem = new MenuItem();
0
by: =?Utf-8?B?SmltSGVhdmV5?= | last post by:
I am have a ASP:Menu with static and dynamic menu items. Each of the static items has dynamic menu items. If the user clicks on a static menu item, which has no click event, then menu item...
3
by: kenny bones | last post by:
Hi! I'm currently working on a menu which is based on CSS and is listed with <li> tags. The CSS code looks like this: #nav { position: absolute; top: 101px; left: 390px; list-style: none;...
2
by: alexandis | last post by:
I have menu bound to sitemap file. This is a piece of code <asp:menu ... > <StaticItemTemplate> <%# ((MenuItem)Container.DataItem).Selected ? : %> </StaticItemTemplate> </asp:menu> I check...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.