asp.net 2.0 master page asp:menu bug

T

tfsmag

Has anyone had a problem with putting a menu control into a master page
in .net 2.0? I have a problem where if i just drop a menu control on a
regular page the menu works fine, the submenus work perfect. But if I
put that exact same code inside a master page, when i go to view one of
the files that use that master page, all of the submenus are out of
wack and instead of being hidden, they are at the bottom of the menu,
and only go back in if i rollover the parent menu item. Any insight
into this would be appreciated.
 
H

Henrik

I have the same behaviour, but only when the pages are viewed in IE.
They render just fine in Firefox.

I have not figured out what is causing it yet.
 
T

tfsmag

yeah, i have a headache from spending the majority of the day trying to
figure out wtf is going on :(
 
H

Henrik

I found this (and it works)
A lot of users are finding that after moving their ASP.NET 1.1 site to ASP.NET 2.0 and then adding a Menu Control to their app, the Menu doesn't work.

The reason this doesn't work is that an extra tag was added to web.config <xhtmlConformance mode="Legacy" /> This flag was meant for 2.0 to act a lot more like 1.1 and one of the major differences is the naming convention of controls. This naming change causes the quirky behavior with Menu in IE.

There are 2 fixes for this issue:

1) Remove the xhtmlConformance tag from web.config
Personally if you can do it, I recommend this option. If you're using ASP.NET 2.0 features, you should try and stick with the new rendering modes.

2) If you can't do #1, then give your masterpage an ID
To do this, add a line to your Page_Load for your Masterpage:

public partial class MasterPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
this.ID = "Master1";
}
}



-------- Original Message --------
From: "tfsmag" <[email protected]>
To:
Subject: asp.net 2.0 master page asp:menu bug
Date: 2/22/2006 2:46 PM
 
Joined
May 29, 2008
Messages
1
Reaction score
0
menu problem.

Henrik said:
I found this (and it works)

> A lot of users are finding that after moving their ASP.NET 1.1 site to ASP.NET 2.0 and then adding a Menu Control to their app, the Menu doesn't work.
>
> The reason this doesn't work is that an extra tag was added to web.config <xhtmlConformance mode="Legacy" /> This flag was meant for 2.0 to act a lot more like 1.1 and one of the major differences is the naming convention of controls. This naming change causes the quirky behavior with Menu in IE.
>
> There are 2 fixes for this issue:
>
> 1) Remove the xhtmlConformance tag from web.config
> Personally if you can do it, I recommend this option. If you're using ASP.NET 2.0 features, you should try and stick with the new rendering modes.
>
> 2) If you can't do #1, then give your masterpage an ID
> To do this, add a line to your Page_Load for your Masterpage:
>
> public partial class MasterPage : System.Web.UI.MasterPage
> {
> protected void Page_Load(object sender, EventArgs e)
> {
> this.ID = "Master1";
> }
> }




-------- Original Message --------
From: "tfsmag" <[email protected]>
To:
Subject: asp.net 2.0 master page asp:menu bug
Date: 2/22/2006 2:46 PM

> Has anyone had a problem with putting a menu control into a master page
> in .net 2.0? I have a problem where if i just drop a menu control on a
> regular page the menu works fine, the submenus work perfect. But if I
> put that exact same code inside a master page, when i go to view one of
> the files that use that master page, all of the submenus are out of
> wack and instead of being hidden, they are at the bottom of the menu,
> and only go back in if i rollover the parent menu item. Any insight
> into this would be appreciated.
>


I am new to asp.net 2.0.
I faced the same menu problem with master pages.
IF I set id for master page in page load it works ok. But I am getting error for gridview control in content page as 'Index out of range. Must be non-negative ....' when i user rowediting event.

Please let me know any solution.
 

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

Similar Threads


Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top