473,516 Members | 3,064 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems with .NET 2 Menu

WT
I use Menu navigation control in an ascx, the Menu if filled with Menuitems
during Load event.
Sub-MenuItems are added to the ChildItems collection.

But on the display the behavior of menu is not working: everything is
written in the same column, without any level considerations.
When I move mouse on dynamics elements, they disappear and never come back.

Is there a problem using Menu in ascx, is there a conflict in javascript.
Is it a known problem ?

Any help welcome.

CS
Apr 1 '06 #1
3 1203
DWS
There are no problems with using menu in ascx. Infact its very easy to cache
it for performance that way. Youre almost there you need a minor mod to your
code thats it.

Create one initial menuitem, to your initial menuitem add the child
menuitems, add your initial menuitem to the menu.

Good Luck
DWS
"WT" wrote:
I use Menu navigation control in an ascx, the Menu if filled with Menuitems
during Load event.
Sub-MenuItems are added to the ChildItems collection.

But on the display the behavior of menu is not working: everything is
written in the same column, without any level considerations.
When I move mouse on dynamics elements, they disappear and never come back.

Is there a problem using Menu in ascx, is there a conflict in javascript.
Is it a known problem ?

Any help welcome.

CS

Apr 1 '06 #2
WT
That's exactly what I am doing ????
Here is my code, whre is the problem ?

private void LoadControl(object sender, EventArgs e) {
if (!Page.IsPostBack)
InitData();
}

protected void InitData() {
// Build list of tabs to be shown to user
List<PageStripDetails> authorizedTabs = GetInnerDataSource();
for (int i = 0; i < authorizedTabs.Count; i++)
{
PageStripDetails myPage = (PageStripDetails) authorizedTabs[i];
AddMenuItem(myPage,0);
}
}

protected virtual void AddMenuItem(PageStripDetails myPage,int level) {
if (PortalSecurity.IsInRoles(myPage.AuthorizedRoles))
{
MenuItem mn = new MenuItem(myPage.PageName, myPage.PageID.ToString());
mn = RecurseMenu(myPage.Pages, mn,level+1);
if (mn.ChildItems.Count == 0)
mn.NavigateUrl = giveMeUrl(myPage.PageName, myPage.PageID);
else mn.Selectable = false;
this.Items.Add(mn);
}
}

protected virtual MenuItem RecurseMenu(List<PageStripDetails> t, MenuItem
mn,int level) {
if (t.Count > 0)
{
for (int c=0; c < t.Count; c++)
{
PageStripDetails mySubTab = t[c];
if (PortalSecurity.IsInRoles(mySubTab.AuthorizedRoles ))
{
MenuItem mnc = new MenuItem(mySubTab.PageName, mySubTab.PageID.ToString());
mnc = RecurseMenu(mySubTab.Pages, mnc,level+1);
if (mn.ChildItems.Count == 0)
mnc.NavigateUrl = giveMeUrl(mySubTab.PageName, mySubTab.PageID);
else mnc.Selectable = false;
mn.ChildItems.Add(mnc);
}
}
}
return mn;
}





"DWS" <DW*@discussions.microsoft.com> a écrit dans le message de news:
00**********************************@microsoft.com...
There are no problems with using menu in ascx. Infact its very easy to
cache
it for performance that way. Youre almost there you need a minor mod to
your
code thats it.

Create one initial menuitem, to your initial menuitem add the child
menuitems, add your initial menuitem to the menu.

Good Luck
DWS
"WT" wrote:
I use Menu navigation control in an ascx, the Menu if filled with
Menuitems
during Load event.
Sub-MenuItems are added to the ChildItems collection.

But on the display the behavior of menu is not working: everything is
written in the same column, without any level considerations.
When I move mouse on dynamics elements, they disappear and never come
back.

Is there a problem using Menu in ascx, is there a conflict in javascript.
Is it a known problem ?

Any help welcome.

CS

Apr 1 '06 #3
WT
Solution found.
My Page was using an override for Render(writer) and something was missing,
When calling the base.render everything is Ok for Menu.
Now problem is What is doing Page.Render thta was missing in myè override.

CS
"DWS" <DW*@discussions.microsoft.com> a écrit dans le message de news:
00**********************************@microsoft.com...
There are no problems with using menu in ascx. Infact its very easy to
cache
it for performance that way. Youre almost there you need a minor mod to
your
code thats it.

Create one initial menuitem, to your initial menuitem add the child
menuitems, add your initial menuitem to the menu.

Good Luck
DWS
"WT" wrote:
I use Menu navigation control in an ascx, the Menu if filled with
Menuitems
during Load event.
Sub-MenuItems are added to the ChildItems collection.

But on the display the behavior of menu is not working: everything is
written in the same column, without any level considerations.
When I move mouse on dynamics elements, they disappear and never come
back.

Is there a problem using Menu in ascx, is there a conflict in javascript.
Is it a known problem ?

Any help welcome.

CS

Apr 2 '06 #4

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

Similar topics

3
2371
by: eternalD3 | last post by:
Hi, I have a problem to get this working on Opera 7.x+. This does not need to work on older Opera browsers There are problems on rendering the sub-level navigation. It aligns right on Firefox and IE 6. Sometimes there are also some problems on IE 5 or IE 5.5. I would like the navigation to work like this:
5
3223
by: Aaron | last post by:
I'm having problems getting my popup menu to work correctly, and was hoping someone here could point me in the right direction. I have the following script: <script> var activeMenu=""; function getObject(id) { var object=eval("document.getElementById('"+id+"')"); return object;
4
1505
by: dpomt | last post by:
Hello, I am using the ASP.NET menu control and I have two issues when the page containing the menu is displayed in Safari on Mac OS X: 1) The menu is not dynamic. Why (it seems that Safari is treated as downlevel browser)? 2) I run into the "DynamicMenuStyle" bug (see http://weblogs.asp.net/dannychen/archive/2005/11/21/431121.aspx) Any...
5
1421
by: le007 | last post by:
:) Hey All, I've recently tried my hand with CSS. I know a good bit of html and thats more or less it. I've moved back to Ireland from Australia now and I'm trying to put a site together to keep in touch with my mates back home. I've got a fair few questions so hopefully some of you cats can help! At the bottom is a link to my website which...
1
1992
by: proplady | last post by:
I've had this menu for some time, and periodically make changes. I've made some changes now (just some menu items), and the menu will not show up on my webpages. I know it's something simple, but I just can't see it. Can anyone help? var NoOffFirstLineMenus=6; // Number of first level items var LowBgColor='white'; // Background...
7
1793
by: joecap5 | last post by:
I have a main window from which I want to open a separate side menu window. I then want to create a list of items on that side menu by clicking on the item names in the main window. So far I am able to click on "Open Menu" and have the side menu open. I can then click on Items and have them added to the side menu using the innerHTML method or...
3
2193
by: =?ISO-8859-1?Q?Jo=E3o_Maia?= | last post by:
Hi there, I am having a weird problem in trying to use a ASP.NET menu inside a custom web part. I am developing a custom web part that has a menu inside (just the menu, nothing else). The menu is a System.Web.UI.WebControls.Menu (ASP.NET 2.0) object. If I add the menu to a simple ASPX web form, it works nice. However, I am adding it to my...
6
1741
by: Liam Gibbs | last post by:
Hello everyone, I'm trying to program a church web site and I'm having a number of problems with the layout. The html is at http://www.altmarvel.net/Liam/index.html and the css is at http://www.altmarvel.net/Liam/OCOC.css. Anyway, the problems are these: 1. The Search stuff underneath the menu and to the right should be
0
7276
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7182
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7408
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7581
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7548
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5714
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4773
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3259
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
825
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.