Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Menu Object Question
Message
De
28/04/2007 12:31:23
 
Information générale
Forum:
ASP.NET
Catégorie:
Menus
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01216226
Message ID:
01220797
Vues:
21
Interesting Ben. Thanks. =0)

~~Bonnie




>Bonnie,
>
>That's corrent. Apparently .Net does not hold onto the Menu Object names during runtime. The only reason I was referring to the "-" ones is because at least I could use the MenuText of all the other items to make them "unique" but if I hade more then one "-" inside a menu branch...I came across a problem. But in answer to your question, yes I did find a work around. It works for me so far... I had to rename all my Menu Items so that their "Names" matched the "Path" that the item belonged to. For Example:
>
>File > Imports > Data File
>
>The above menu item would have the name mnuFile_Imports_DataFile
>
>Then when I converted the mnuItem to a string representation, I could take the menu items path, and recreate the menu item name. If the Path & Name differ, then I would have a problem. So unfortunatly its an extra item that my programmers have to keep in mind when modifying the menu structure....but I suppose its minor enough to not complain about. I still don't understand what the MS Programmers were thinking when they did this...to not carry over the object names into runtime makes no sense to me.
>
>In case you were wondering how I convert menu to text...I created a class that accepts a MenuObject as a parameter, then using the class, it traverses the Menu Object recursivly to deconstruct the entire menu and convert it to a text representation. That representation can be display via the class as a PIPE delimited string, or as an Array of Strings. Either way, each menu item is created using the menu items complete path location.
>
>>Ben,
>>
>>At runtime, I'm not seeing names for *any* of the MenuItems, not just the "-" ones. Have you managed yet to find a way around this?
>>
>>~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform