473,383 Members | 1,952 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,383 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 1781
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
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.