473,574 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MasterPages - Dynamically Created Menus Disappearing

I am playing around with creating some menus
dynamically, and they
create fine and show up ok when I want them to; but
when I select a
menu NavigateUrl at run time, the applicable url shows
up as
anticipated in the content place holder but the menu
disappears...

the menu is part of the master page and is not in the
content place holder...

anybody have any ideas?

am I missing something obvious?

when I create the same menu at design time it does not
exhibit this behavior...

thanks in advance.

Oct 23 '06 #1
23 12519
"LvBohemian " <Lv********@dis cussions.micros oft.comwrote in message
news:29******** *************** ***********@mic rosoft.com...
the menu is part of the master page and is not in the
content place holder...
That's good, but where is the code which does the dynamic generation of the
MenuItems collection...?
Oct 23 '06 #2
This is how I am binding, with the exception that I am calling
CreateMenuItemB inding from within the click event of a button for test
purposes...

http://msdn2.microsoft.com/en-us/lib...ollection.aspx

As I said everything works fine, all menu items show up as anticipated, then
when I select a menu item which loads the applicable NavigateUrl into the
MasterPage ContentPlaceHol der I lose the menu, it disappears, although the
NavagateUrl *.aspx appears in the ContentPlaceHol der as it should...

If I can get the menu to stick around after I select the NavigateUrl from
the menu I created dynamically and display the NavigateUrl in the MasterPage
ContentPlaceHol der, then I can move forward with my idea that I am kicking
around...

Thanks in advance.

Oct 23 '06 #3
"LvBohemian " <Lv********@dis cussions.micros oft.comwrote in message
news:4A******** *************** ***********@mic rosoft.com...
when I select a menu item which loads the applicable NavigateUrl into the
MasterPage ContentPlaceHol der
I'm not sure what you're doing here...

Generally speaking, in the MasterPage / ContentPage architecture, you do not
dynamically select the ContentPage through a menu - instead, you simply
navigate to another ContentPage which, when it loads, picks up its
MasterPage and merges the two files into one HTML document...

E.g. if you have Page1.aspx and Page2.aspx, both of which are ContentPages
and use the same MasterPage, your MenuItem should simply navigate to
Page2.aspx through its NavigateUrl property - it should certainly not be
trying to play about with the contents of the ContentPlaceHol der on the
MasterPage...
Oct 23 '06 #4
I hope this explains it better...

The master page that I am dynamically creating a menu on works fine...

I am trying to select the content page that I want to display on the same
master page; from the dynamic menu I created, much as you would do from a
TreeView control as is done on the MSDN page, it works as anticipated if I
create a static menu at design time; but using the same settings at runtime,
when I select a menu item it does display the content page as it is supposed
to but the menu disappears, even though it is part of the master page...
I want the menu to stick around in case I want to load a different content
page instead in the same MasterPage…

Thanks in advance.

Oct 23 '06 #5
"LvBohemian " <Lv********@dis cussions.micros oft.comwrote in message
news:AC******** *************** ***********@mic rosoft.com...
>I hope this explains it better...
I'm afraid it doesn't...
I want the menu to stick around in case I want to load a different content
page instead in the same MasterPage.
Still seems to me that you're doing this backwards...

Menus don't really work the same way as TreeViews...

To change the ContentPage, you simply navigate to the other ContentPage - it
will automatically pick up its MasterPage and redraw the menu for you...
Oct 23 '06 #6
I am navigating to the applicable content page, using the NavigateUrl that is
selected via the menu, when I do the menu disapears...
Oct 23 '06 #7
Dump a button on the masterpage and click on it..
Will the menu dissapear as well?
This is usually due not rebuilding the menu again on page load.

sorry if i'm way off here.

"LvBohemian " <Lv********@dis cussions.micros oft.comschreef in bericht
news:DF******** *************** ***********@mic rosoft.com...
>I am navigating to the applicable content page, using the NavigateUrl that
is
selected via the menu, when I do the menu disapears...

Oct 23 '06 #8
thats how I am testing it, when I click on the button on the master page, I
dynamically build a menu, and it looks and works like I want it to at that
point...
then when I select a menu item which is wired to NavigateUrl to display the
applicable content page in the same master page's content place holder, it
shows the content page but the menu disappears...

thanks in advance.

Oct 23 '06 #9
"LvBohemian " <Lv********@dis cussions.micros oft.comwrote in message
news:DF******** *************** ***********@mic rosoft.com...
>I am navigating to the applicable content page, using the NavigateUrl that
is
selected via the menu, when I do the menu disapears...
Ah well alright then - but that isn't, in fact what you actually said... You
said "...then when I select a menu item which loads the applicable
NavigateUrl into the MasterPage ContentPlaceHol der...", which is what I
thought you meant!

That's fine - you appear to be doing it correctly - you just have a problem
with nomenclature. Selecting a menu item doesn't load the applicable
NavigateUrl into the MasterPage ContentPlaceHol der - it's precisely the
reverse. Selecting a menu item navigates to the ContentPage which loads its
MasterPage.

However, that's by the by...

Back to the original question - where is the code which does the dynamic
menu creation...?
Oct 23 '06 #10

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

Similar topics

2
1741
by: clintonG | last post by:
Does anybody know how to use a control such as the DropDownList to change Themes when using MasterPages? I'm also asking in the forum. <%= Clinton Gallagher METROmilwaukee (sm) "A Regional Information Service" NET csgallagher AT metromilwaukee.com URL http://metromilwaukee.com/ URL http://clintongallagher.metromilwaukee.com/
6
1755
by: Kenneth Keeley | last post by:
Hi, I have a Masterpage that controls the basic layout of the pages displayed on a web site. The masterpage also uses some variables. I would like to be able to access some of these variables from the content pages. Can this be done and if so how. I have made the Varibles that I wish to access Public Members. Thanks for any help. Kenneth
2
2456
by: iturner100 | last post by:
Hi, I've been struggling with this one for a couple of hours without much joy. Basically, I've got a set of nested masterpages (3 as it happens). I'm dynamically generating a new page in code and want to be able to populate the ContentPlaceholders of the inner-most masterpage at run-time.
6
1853
by: Tony Marston | last post by:
I have a site at http://www.radicore.org which has a menu bar down the left hand side. When certain menu items are selected (What is Radicore? Products, Documentation, Licensing, Legal) a sub-menu automatically appears. This works fine in FF and Opera, but in IE as soon as the "Legal" option, or any of its sub-menus, are selected, all the...
6
1973
by: =?Utf-8?B?U3RlcGhlbiBIYXRmaWVsZA==?= | last post by:
I have two masterpages in a web application. One is used for the login and logout pages. The other is used for all other pages in the application. The difference between the two masterpages is that on the main one I have a user control in the left side that has the site navigation menu while the login/logout masterpage has a non-breaking...
6
1467
by: =?Utf-8?B?UGV0ZXJX?= | last post by:
I have 3 master pages. The second has a contents object that contains the horizontal menu, the third a contents object that contains the vertical menus and all WebForms use master3 as their Master Page. The content of any WebForms is below the horizontal menu and right of the left hand menu. My problem is that the menu structure is 5 layers...
1
1839
by: =?Utf-8?B?UGV0ZXJX?= | last post by:
I have 3 master pages. The second has a contents object that contains the horizontal menu, the third a contents object that contains the vertical menus and all WebForms use master3 as their Master Page. The content of any WebForms is below the horizontal menu and right of the left hand menu. My problem is that the menu structure is 5 layers...
0
1368
by: Syoam4ka | last post by:
My project is about jewellery. I have devided my jewelery into main types, which each one of them has sub types, and each one those sub types has the jewellery. I have a tabcontainer. It includes tabpanels such as:Catalog,Terms,SiteMap.ViewCart ,etc. All the jewellery Intro is in the Catalog panel. when I first click the Catalog panel it...
7
1374
by: Malakie | last post by:
Hi all, I am trying to self teach VB .net to myself. Not sure what is worse, trying to accomplish this or thinking I can actually do it! ;-) Anyhow, Would someone be able to give me some example VB net code that would create buttons on a form dynamically for each drive (cd or HD or virtual etc) found on a system; labeling each created...
0
7716
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
8226
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...
1
7806
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6442
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...
1
5612
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5297
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
3739
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3748
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1053
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.