newbie: combining 2 menus

Discussion in 'ASP .Net' started by Jeff, Jul 18, 2006.

  1. Jeff

    Jeff Guest

    hey

    asp.net 2.0

    I have 2 menu controls on my website. One menu displays the top menu items:
    Home, Item A, Item B, Item C.....

    The problem is that when clicking on the "Home" menuitem, the user isn't
    redirected to Default.aspx, but all the other menu items works..
    Default.aspx are using a different master page than all the other pages in
    my project (see the copy of my sitemap file below)

    Any suggestions on how to solve this is very welcome!

    The is the code in my main menu which tells the sub menu what menu items to
    display
    protected void mnuHeader_MenuItemClick(object sender, MenuEventArgs e)
    {
    SiteMapDataSource dataSource =
    (SiteMapDataSource)lvSidebar.FindControl("SiteMapDataSource1");
    switch (e.Item.Value)
    {
    case "Home":
    dataSource.StartingNodeUrl = "Default.aspx";
    return;
    case "Item A":
    dataSource.StartingNodeUrl = "~/test3.aspx";
    return;
    case "Item B":
    dataSource.StartingNodeUrl = ""~/test4.aspx";
    return;
    }
    }

    Here is my .sitemap file:
    <?xml version="1.0" encoding="utf-8" ?>
    <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode url="Default.aspx" title="Home" description="">
    <siteMapNode url="~/test3.aspx" title="Item A" description="" >
    <siteMapNode url="~/test4.aspx" title="Sub Item 1" description=""
    />
    </siteMapNode>
    <siteMapNode url="~/test4.aspx" title="Item B" description="" >
    <siteMapNode url="" title="Item C" description="" />
    </siteMapNode>
    <siteMapNode url="" title="Item D" description="" />
    </siteMapNode>
    </siteMap>
    Jeff, Jul 18, 2006
    #1
    1. Advertising

  2. Jeff

    Jeff Guest

    MORE INFO here

    After more testing I've discovered that no menu item is working (when I
    click on a menu item, then I'm not redirected to it's page)

    Please, what is your suggestion?

    Jeff


    "Jeff" <> wrote in message
    news:...
    > hey
    >
    > asp.net 2.0
    >
    > I have 2 menu controls on my website. One menu displays the top menu
    > items: Home, Item A, Item B, Item C.....
    >
    > The problem is that when clicking on the "Home" menuitem, the user isn't
    > redirected to Default.aspx, but all the other menu items works..
    > Default.aspx are using a different master page than all the other pages in
    > my project (see the copy of my sitemap file below)
    >
    > Any suggestions on how to solve this is very welcome!
    >
    > The is the code in my main menu which tells the sub menu what menu items
    > to display
    > protected void mnuHeader_MenuItemClick(object sender, MenuEventArgs e)
    > {
    > SiteMapDataSource dataSource =
    > (SiteMapDataSource)lvSidebar.FindControl("SiteMapDataSource1");
    > switch (e.Item.Value)
    > {
    > case "Home":
    > dataSource.StartingNodeUrl = "Default.aspx";
    > return;
    > case "Item A":
    > dataSource.StartingNodeUrl = "~/test3.aspx";
    > return;
    > case "Item B":
    > dataSource.StartingNodeUrl = ""~/test4.aspx";
    > return;
    > }
    > }
    >
    > Here is my .sitemap file:
    > <?xml version="1.0" encoding="utf-8" ?>
    > <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    > <siteMapNode url="Default.aspx" title="Home" description="">
    > <siteMapNode url="~/test3.aspx" title="Item A" description="" >
    > <siteMapNode url="~/test4.aspx" title="Sub Item 1"
    > description="" />
    > </siteMapNode>
    > <siteMapNode url="~/test4.aspx" title="Item B" description="" >
    > <siteMapNode url="" title="Item C" description="" />
    > </siteMapNode>
    > <siteMapNode url="" title="Item D" description="" />
    > </siteMapNode>
    > </siteMap>
    >
    Jeff, Jul 18, 2006
    #2
    1. Advertising

  3. Jeff

    Jeff Guest

    CASE SOLVED

    "Jeff" <> wrote in message
    news:...
    > After more testing I've discovered that no menu item is working (when I
    > click on a menu item, then I'm not redirected to it's page)
    >
    > Please, what is your suggestion?
    >
    > Jeff
    >
    >
    > "Jeff" <> wrote in message
    > news:...
    >> hey
    >>
    >> asp.net 2.0
    >>
    >> I have 2 menu controls on my website. One menu displays the top menu
    >> items: Home, Item A, Item B, Item C.....
    >>
    >> The problem is that when clicking on the "Home" menuitem, the user isn't
    >> redirected to Default.aspx, but all the other menu items works..
    >> Default.aspx are using a different master page than all the other pages
    >> in my project (see the copy of my sitemap file below)
    >>
    >> Any suggestions on how to solve this is very welcome!
    >>
    >> The is the code in my main menu which tells the sub menu what menu items
    >> to display
    >> protected void mnuHeader_MenuItemClick(object sender, MenuEventArgs e)
    >> {
    >> SiteMapDataSource dataSource =
    >> (SiteMapDataSource)lvSidebar.FindControl("SiteMapDataSource1");
    >> switch (e.Item.Value)
    >> {
    >> case "Home":
    >> dataSource.StartingNodeUrl = "Default.aspx";
    >> return;
    >> case "Item A":
    >> dataSource.StartingNodeUrl = "~/test3.aspx";
    >> return;
    >> case "Item B":
    >> dataSource.StartingNodeUrl = ""~/test4.aspx";
    >> return;
    >> }
    >> }
    >>
    >> Here is my .sitemap file:
    >> <?xml version="1.0" encoding="utf-8" ?>
    >> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    >> <siteMapNode url="Default.aspx" title="Home" description="">
    >> <siteMapNode url="~/test3.aspx" title="Item A" description="" >
    >> <siteMapNode url="~/test4.aspx" title="Sub Item 1"
    >> description="" />
    >> </siteMapNode>
    >> <siteMapNode url="~/test4.aspx" title="Item B" description="" >
    >> <siteMapNode url="" title="Item C" description="" />
    >> </siteMapNode>
    >> <siteMapNode url="" title="Item D" description="" />
    >> </siteMapNode>
    >> </siteMap>
    >>

    >
    >
    Jeff, Jul 18, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. news.west.cox.net

    Select menus above flyout menus? help?

    news.west.cox.net, Dec 8, 2004, in forum: HTML
    Replies:
    8
    Views:
    782
  2. Jeff
    Replies:
    2
    Views:
    411
    David Wier
    Nov 2, 2006
  3. richard

    combining menus problem

    richard, Feb 26, 2012, in forum: HTML
    Replies:
    6
    Views:
    360
    Tim Streater
    Feb 27, 2012
  4. Naji

    Combining Code, Newbie Issues.

    Naji, Nov 4, 2005, in forum: Perl Misc
    Replies:
    3
    Views:
    74
  5. Replies:
    32
    Views:
    644
Loading...

Share This Page