CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 11/23/2005 1:43:37 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 5 Views: 40 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
6 Items, 1 Pages 1 |< << Go >> >|
walker69
Asp.Net User
Menu control does not work when placed into master page11/23/2005 1:43:37 PM

0/0

Hi all,
I have big problem when using Internet Explorer 6.0 (and may be other versions and may be other browsers).
My Menu control does not work when it is placed into master page.

Let me explain the problem:

When I place Menu control to master page, the result generated html looks like this:

<head id="_ctl0_Head1"><title>
    GtsNovera Call system
</title><meta http-equiv="Content-type" content="text/html; charset=Windows-1250"><link href="Styles/Styles.css" media="all" rel="Stylesheet" rev="Stylesheet" /><style type="text/css">
    ._ctl0_Menu1_0 { background-color:white;visibility:hidden;display:none;position:absolute;left:0px;top:0px; }
    ._ctl0_Menu1_1 { color:#284E98;font-family:Verdana;font-size:10px;text-decoration:none; }
    ._ctl0_Menu1_2 { color:#284E98;background-color:#B5C7DE;font-family:Verdana;font-size:10px;height:20px; }
    ._ctl0_Menu1_3 {  }
    ._ctl0_Menu1_4 { padding:2px 5px 2px 5px; }
    ._ctl0_Menu1_5 {  }
    ._ctl0_Menu1_6 { padding:2px 5px 2px 5px; }
    ._ctl0_Menu1_7 { background-color:#B5C7DE; }
    ._ctl0_Menu1_8 { color:White; }
    ._ctl0_Menu1_9 { background-color:#507CD1; }
    ._ctl0_Menu1_10 { color:White; }
    ._ctl0_Menu1_11 { background-color:#507CD1; }
    ._ctl0_Menu1_12 { color:White; }
    ._ctl0_Menu1_13 { color:White;background-color:#284E98; }
    ._ctl0_Menu1_14 { color:White; }
    ._ctl0_Menu1_15 { color:White;background-color:#284E98; }

</style></head>

And here comes the problem.
Even I tried to name all the controls, .NET automatically adds prefix _ctl0 before my Header name and even before Menu.
This is big problem, because the CSS classes are genereated then with _ (underscore) before name and IE6 cannot process them.
The FireFox renders it absolutely ok, however IE6 displays the menu wrong. (without styles, so that it is impossible to use it)

The same problem occurs when I name my menu for example _Menu1. It even does not have to be in master page.
The underscore character screws it up.

How can I fix this problem?
Or what do I wrong?

Thank you for reply.
walker


dannychen
Asp.Net User
Re: Menu control does not work when placed into master page11/23/2005 5:53:57 PM

0/0

Walker,
  I filed a bug about styles if the control ID starts with an _ but that said it's very low priority because it has an obvious workaround and is somewhat nonstandard.  However, you shouldn't be seeing this happen normally.  It looks like there is something wrong with your control tree.  Here's what I tried and what I got:

<%@ Master Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Menu ID="Menu1" runat="server">
        <StaticMenuItemStyle BackColor="#80FF80" />
        <Items>
            <asp:MenuItem Text="New Item" Value="New Item" />
        </Items>
    </asp:Menu>
        <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
        </asp:contentplaceholder>
    </div>
    </form>
</body>
</html>


Output:

<style type="text/css">
 .ctl00_Menu1_0 { background-color:white;visibility:hidden;display:none;position:absolute;left:0px;top:0px; }
 .ctl00_Menu1_1 { text-decoration:none; }
 .ctl00_Menu1_2 {  }
 .ctl00_Menu1_3 {  }
 .ctl00_Menu1_4 { background-color:#80FF80; }

</style></head>

One thing you can do to debug is set Trace="true" in your <%@ Page %> directive of the content page.  You'll see a lot of diagnostic infomration, look for the section called "Control Tree".  You may be able to decipher from the output where the problematic control is.  If you figure it out, please let me know what you find.  If you are stuck, can you share some of your masterpage markup with me so I can try it on my side. 
--
Danny


disclaimer: Information provided is 'as is' and conveys no warranties or guarantees.
mighty_man
Asp.Net User
Re: Menu control does not work when placed into master page11/25/2005 1:44:03 PM

0/0

I?m having trouble with the menu control in masterpages.

The problem is with Selected styles.

I?ve read about this on other sites like: http://forums.asp.net/1121854/ShowPost.aspx

But to get it selected right I have to use

<code>

Protected Sub MenuNavigation_MenuItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MenuEventArgs) Handles MenuNavigation.MenuItemDataBound

   If e.Item.NavigateUrl = SiteMap.CurrentNode.Url Then e.Item.Selected = True

End Sub

</code>
walker69
Asp.Net User
Re: Menu control does not work when placed into master page11/27/2005 10:25:26 PM

0/0

Thank you for kicking me to the right direction.
This caused the problem:

        <xhtmlConformance mode="Legacy"/>

DevinX
Asp.Net User
Re: Menu control does not work when placed into master page12/1/2005 9:33:14 PM

0/0

I have the same problem as well and what i've noticed is whenever the underscore is placed before the variable name of the CSS Class it chokes the output of the DHTML menu. So what exactly needs to be done to remove the underscore from the CSS Class names????

What i've done to test this theory is ran my application then copied the source code and ran a replace all fucntion on the _ClassVariableName to ClassVariableName, then saved the output into a regular html file and viewed... The view was fine after removing the _.

So.... Any ideas anyone? Oh and by the way... Mozilla doesn't seem to choke on this problem... Only IE.

DevinX
Asp.Net User
Re: Menu control does not work when placed into master page12/1/2005 11:04:32 PM

0/0

AWww THanks for pointing me in the right direction now. I do not understand how you got the <xhtmlConformance mode> tag from the Trace, but hey it solved my problem now.....

And for any of those who have read this and might not understand what the <xhtmlConformance mode="Lagacy" /> tag is all about... Here is a webpage that describes it further:

http://weblogs.asp.net/scottgu/archive/2005/09/03/424363.aspx

And for those of you who just want the answer to the fix all you have to do is simply go into your web.config file and change the:
 
<xhtmlConformance mode="Lagacy" />
to
<xhtmlConformance mode="Strict" />

This turns on strict XHTML Compliance, meaning it will not put the Underscores at the begining of the AutoGenereated IDs.

6 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages Authors: Jacob J. Sanford, Pages: 474, Published: 2007
Desktop Publishing with Pagemaker for the IBM PC AT, PS/2, and Compatibles: For the IBM PC AT, PS/2 and compatibles Authors: Tony Bove, Cheryl Rhodes, Pages: 222, Published: 1987
Pro C# 2008 and the .NET 3.5 Platform Authors: Andrew Troelsen, Pages: 1370, Published: 2007
InDesign CS3 For Dummies Authors: Galen Gruman, Pages: 414, Published: 2007
The Software Catalog: Microcomputers, Winter, 1990 Authors: Menu International Software, Pages: 0, Published: 1990

Web:
Menu control does not work when placed into master page - ASP.NET ... My Menu control does not work when it is placed into master page. Let me explain the problem: When I place Menu control to master page, ...
Microsoft Enterprise Content Management (ECM) Team Blog ... I am also having problems with this control. I have integrated it into the master page, but it does not seem to do one thing. The menu doesn't change, ...
Master Pages In ASP.NET 2.0 Jul 18, 2005 ... One the master page has injected itself into the control hierarchy it .... Since the master page does not know the title of the content page ...
Walkthrough: Creating and Using ASP.NET Master Pages in Visual Web ... Click the smart tag on the Menu control, and click Edit Menu Items in the Menu ..... NET page does not supply content for the placeholder, the master page ...
problems with referencing control from master page on content page referencing a menu control that is placed on a master page from a content ... does not work at all. Visual Studio says "Type 'KostenMenuA. ...
ASP.NET Resources - Code Blocks Inside Master Pages Cause Trouble A search in user groups revealed that the HtmlHead control does not ..... only way I get Rollover menu buttons with active anchors to work on a master page ...
How to create and use a master page in Visual Studio 2005(VS2005 ... Click the smart tag on the Menu control, and click “Edit Menu Items” in the Menu ... A content page does not have the usual elements that make up an ASP. ...
ASP.NET Menu Control's MenuItemClick event does not fire - Stack ... ASP.NET Menu Control’s MenuItemClick event does not fire .... What is the Best Way to Populate a Menu Control on a Master Page ...
menu control in master page does not get styles in ie 6.0 - ASP ... menu control in master page does not get styles in ie 6.0. Last post 02-28-2007 7:49 AM by John_Idol. 11 replies. Sort Posts: ...
Developing a Custom Master Page (Master Pages and SharePoint part ... Now that we have an understanding of how master pages work and how .... Your menu control should be vertical now. (Please not the intent of the above change ...

Videos:
Charlie Rose - Media Coverage of the war in Iraq / Eduardo Galeano Segment 1: A panel on media coverage of the war in Iraq with guest host Mary Matalin, former counselor to Vice President Cheney. She talks to Michae...
Exploratory Testing Google Tech Talks March 16, 2006 Jon Bach
Full Focus: Tax Returns For Sale; New Medicine; Violinist Mark O'Conner new IRS proposal would make this legal with just a signature on a consent form. On Wednesday's Full Focus, it's a marketer's dream -- but could also ...




Search This Site:










login check

force fully login after logout -help

accidentally set the login page to home....

referrer page when using the menu

orcas beta 2

help: login page gone

one currency, different cultures

whats the most complete available membership solution you've seen?

boring skin...

php md5 and .net md5 functions do not produce the same thing.

retrieve "page name"

beginner pointers ...

forms authentication

staticselectedstyle for a menu control

clicking 'customize create user step' at createuserwizard does not do anything

upgrade dnn 3.0.12 to 3.0.13

portalalias: am i doing something wrong?

the difference between implementing an interface method implicitly and explicitly?

get role by role id

dont show the links

can masterpage code behind control contrent page display?

service unavailable error????

modify menu adapter to show selected <ul> element

executescalar always returns 0

get applcation to run on iis 7.0

upgrade options for dnn 3.0.13 - help!!

loginstatus hierarchy issues

the dynamic usercontrol and webpart paradox...

unable to find an entry point named enumeratesecuritypackagesw in dll security.dll

extend linq to handle mundane business logic

 
All Times Are GMT