newbie: combining 2 menus

J

Jeff

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>
 
J

Jeff

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
 
J

Jeff

Jeff said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top