Web Forms :: Menu Control CSS Styling Broken In .NET 4?

Apr 16, 2010

I'm in the process of styling an asp.net menu in .NET 4 and I'm trying to understand the meaning of the StaticSelectedStyle-CssClass and StaticHoverStyle-CssClass parameters.My understanding is that the styles defined with these parameters are applied as CSS classes to the relevant elements, whenever needed. So I created my menu as follows:

[Code]....

It works for StaticMenuStyle-CssClass and StaticMenuStyle-CssClass (the classes are applied to the relevant elements), but StaticSelectedStyle-CssClass and StaticHoverStyle-CssClass are not applied, regardless of the selected or hover status of an element.
Here is the generated HTML:

[Code]....

So as you can see, StaticMenuStyle and StaticMenuItemStyle are applied, but not StaticSelectedStyle-CssClass or StaticHoverStyle-CssClass. Not sure why. I know I can use selected but isn't the expected behavior that StaticSelectedStyle-CssClass be applied??? By using selected I make assumptions as to what .NET does behind the scenes and that's not right.

View 2 Replies


Similar Messages:

How To Disable The Menu Control From Styling Itself In Javascript

Jun 19, 2010

I'm using Visual Studio 2010 and ASP.NET 4.0 to render a Menu control as an HTML list so I can style it using CSS. Here is the code I am using below

<asp:Menu ID="navlist" runat="server" Orientation="Horizontal"
SkipLinkText="" ClientIDMode="Static" DataSourceID="MenuSource"
MaximumDynamicDisplayLevels="0" IncludeStyleBlock="False"
StaticDisplayLevels="2">
</asp:Menu>

This produces the following HTML

[Code]....

At first glance this looks like exactly what I wanted. However, if I open up WebResource.axd there is a whole bunch of javascript code related to the menu. Part of this code is applying it's own inline styles to the list. Using FireBug I can view the HTML markup after the javascript has executed and it looks something like this:

[code]....

These inline styles ultimately affect the layout of my page. I have no need for any of the scripts in WebResource.axd. How can I prevent this script from being rendered in the final markup of the page?

View 1 Replies

Styling Menu Control Using Vertical Line As Separator Between Items

Oct 21, 2011

I have seen many web sites using a vertical line as separator, between menu items. How can I create a menu with that line..?Is there any link about styling menu control ?

View 2 Replies

Styling Menu - Show That All Parent Menu's Are Selected?

Mar 27, 2010

I'm trying to style an asp:Menu, so that when I hover over a child menu, all the parent menu's will have the background mouse over selected colour. (Take a look at the win xp start menu for example, with default theme blue, all parent menu's will be highlighted as blue if a child is selected) At first I thought this was something simple, but after intense researching (google), I am beginning to wonder...

View 3 Replies

ASP:Menu Broken In IE 8?

Dec 22, 2010

I'm using an ASP:Menu control declared in markup as:

[Code]....

This is a simple menustrip that just gives the viewer of my webpage the ability to set the natural size of the page to something more suitable to the size of their browser window or screen resolution.
The onclick code:

[Code]....

This is ridiculously simple stuff; the Session Resolution set by the click event is checked and accounted for in Page Init and PreRender and isn't relevant to this issue.In Visual Studio 2008 Debug mode on Windows 7, the page and its Menustrip load and work just fine in Firefox and also IE8 - everything works exactly as expected.After moving the project to my deployment platform (a Windows 2003 STD Server running IIS), the page continues to work just fine in Firefox but in IE8 (from the same Win7 machine I tested IE8 with in debug mode) the Menustrip won't work in IE8... the top-level shows, but when I move my mouse over the Page Size link it doesn't pop out the various size options - the left border edge disappears but the menu items don't appear. I've verified that Javascript is enabled in IE8.

View 1 Replies

C# - Styling Menu Controls With Standard Css?

Jul 11, 2010

I have a piece of piece of HTML which looks like this -

<div id="moduleList">
<ul>
<li class="noBorder"> </li>
<li class="noBorder">
<span class="currentTabLeft"> </span><span class="currentTab">
<a href="Welcome.aspx"
id="grouptab_0">Home</a>
</span><span class="currentTabRight"> </span>

[Code]....

Is there a way to force the asp:Menu control to spit out ul and li instead of tables, so that I can use my existing css styles to style them correctly or is that a lost cause?

View 1 Replies

Web Forms :: Styling Listitems In Radiobuttonlist Control Or Checkboxlist Control?

Mar 7, 2011

for the radiobuttonlist control, when I try to style individual buttons with 'span'I get a error, is there some way to style each button?

[Code]....

error is:

System.Web.UI.WebControls.ListItemCollection must have items of type 'System.Web.UI.WebControls.ListItem'. 'span' is of type 'System.Web.UI.HtmlControls.HtmlGenericControl

View 6 Replies

Forms Data Controls :: Styling The Gridview Control

Aug 20, 2010

using .net 4 and vs 2010 I have a gridview control that refuses to wrap the text in one column in IE 8, Safari 5 and Chrome 5, resulting in the grid extending outside of the page wrapper. I've got it to behave in IE 7 by creating a CSS class like so:

[Code]....

FF and Opera seem to rendere it correctly without any styling whatsoever. I've tried using the <ItemStyle wrap="true" /> property with no success. I've tried setting the wrap property in the designer with no success.

View 2 Replies

C# - Can A Web User Control (.ascx) Use A CSS File For Styling

Jun 27, 2010

Here's the source of a blank .acsx file I created called LogOnBox.

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LogOnBox.ascx.cs" Inherits="ECommerce.Views.Shared.LogOnBox" %>

I want to drag some labels, and textboxes etc and give them style using a CSS file. How can I associate a CSS to an acsx file?

View 3 Replies

Web Forms :: Add/Remove Default Classes From The Menu Generated From The TreeView Or Menu Control

Apr 5, 2010

Is there a way to add/delete/update the default classes (for instance AspNet-Menu-WithChildren,AspNet-Menu-NonLink ) of the html generated by the asp.net menu or treeview control? I am using CSSAdapters so the menu control renders in a list format instead of table format.

View 1 Replies

Web Forms :: Style The Menu Control To Allow The Menu Items To Float To The Right Of The Container?

Feb 3, 2011

Currently I have a menu control on my webform in ASP.Net 4.0 :

<div class="PNMenu">
<asp:SiteMapDataSource ID="PNSiteMap" runat="server" ShowStartingNode="false" />
<asp:Menu ID="PNMainMenu" runat="server" DataSourceID="PNSiteMap" RenderingMode="List" Orientation="Horizontal" CssClass="PN-PrimaryNavMenu" >
</asp:Menu>
</div>

I am trying to style the menu control to allow the menu items to float to the right of the container, however I am unable to do so as whenever I am styling the a, ul or li it keeps getting overidded by asp.net and floats everything left.

.PNMenu
{
clear:both;

[code]...

View 5 Replies

Web Forms :: Change Background Color Of Selected Menu In Menu Control?

Jul 15, 2013

i have a asp menu in master page and it is populated from database. 

i want if user click a link that menu link's background color should change how to do?  

View 1 Replies

Web Forms :: Hide Some Menu Items For Non Logged In Users In Menu Control

Apr 8, 2013

What I want is to show menu items Administrator or show user menu items.Show menu items using login...How I can do it with role  provider, control menu and siteMap in masterpage?

View 1 Replies

Web Forms :: Save Data While Changing Menu / Place The Menu Control In The Mater Page?

Mar 17, 2010

We have to develop an application which has a Vertical left pane menu control which displays all the web pages (A,B,C say). Now if user is in page A and filled some data and clicks on menu control to go to page B, all the data in page A needs to be saved. Also if all the required field in page A are not filled and user navigated to page B, there will be one ! sign after the menu so that user can understand that there some some more fields need to be filled up.

We are planning to place the menu control in the Mater page. Please give me some direction to do this. My question is:

1. If user change menu (In Master Page), how should we save data?

2. How should we display the ! in the menu control?

View 2 Replies

Web Forms :: Menu Control - Does Not Render Image On Dynamic Menu

Sep 2, 2010

I am doing a rework on one of my sites and I am attempting to use the asp:menu control.

I am using images in the static and dynamic menus. Hard coded at this point.

On my local machine it works fine but when I upload to the server, the image on the dynamci menus do not appear.

Instead I just get white space where the images should be.

Here is the code:

[code]

View 2 Replies

Web Forms :: Display A Context Sensitive Menu Using Menu Control?

Jul 28, 2010

I know that the code depicted below will not work but I am including it to convey the idea of what I wish to accomplish. I want to use a different SiteMap to construct the menu on the displayed page for each of three different classes of service (COS).

I set a session variable named "COS" at the login and want to test its value prior to rendering each page. I want to display a menu based upon the appropriate COS. Here is my first stab at it but I know that I cannot include <asp:...> controls within the "case" statements. Can anyone suggest methods of doing this? I know C# and can use that but I do not know how to select the proper sitemap within the <menu> control. I am also using a CSS in my production version.

[Code]....

View 2 Replies

Web Forms :: Menu Item Click Event For Menu Control

May 7, 2015

Sitemap & Menu:

<asp:SiteMapDataSource ID="Menu" runat="server" ShowStartingNode="false" />
<asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" OnMenuItemDataBound="OnMenuItemDataBound" DataSourceID="Menu" >
<LevelMenuItemStyles>
<asp:MenuItemStyle CssClass="Menu" />
<asp:MenuItemStyle CssClass="Level" />
</LevelMenuItemStyles>
</asp:Menu>
<siteMapNode url="javascript:Logout" title="Logout" description="Logout" roles="*">
<siteMapNode title="Logout" description="Logout"></siteMapNode>
</siteMapNode>

I want OnClick event instead of navigation .

View 1 Replies

AJAX :: Styling Modal Popup Extender Control

Jan 21, 2010

How to style ajax modal popup extender control just like in forums.asp.net site which when loaded displays a modal popup with close button. i dont want to show the popup every time if an user submits or cancels the popup once.

View 7 Replies

Web Forms :: Menu Control Click Event Not Firing / How To Pass The Selected Menu Item Text To The Other Page

Jan 10, 2011

I am using frames in my webpage.in one of the frames i have a menu control whose items are database driven.when click on the menu item, i want another page to be displayed in other frame.

now i want to pass the the selected menu item text to the other page using session variable which is in the menu item click event method.but the thing is when i click on the menu item, the click event is not firing.

is there any better way to pass the selected menu item text to the other page?

View 1 Replies

Web Forms :: JQuery Dropline Menu Using Menu Control

Feb 28, 2010

I am trying to implement dropline menu using asp.net menu control. I found JQuery dropline code @ Dynamic Drive & currently using CssFriendly Adapters to get neet CSS, but i am unable to implement it as menu control renders its own css names.

View 1 Replies

Web Forms :: Finding Menu Item From Menu Control?

Apr 15, 2010

I am working with asp.net 2.0 I have 1 problem Regarding Menu Control I used menu control in Master page. Now I have to find out Menu Item from Menu control depending on Condition. how to do that on server and Client side.

My code:

<asp:Menu runat="server" Orientation="Horizontal">
<StaticMenuItemStyle CssClass="jobTabNormal" />
<StaticSelectedStyle CssClass="jobTabSelected" />
<DynamicHoverStyle CssClass="jobTabHover" Font-Bold="true" />
<DynamicMenuStyle />
<DynamicSelectedStyle CssClass="jobTabDynamicSelected" />
<Items>
<asp:MenuItem Text="Job Details" Selected="true" NavigateUrl="#" Enabled="true">
</asp:MenuItem>
<asp:MenuItem Text="Cargos" Enabled="false" NavigateUrl="~/Pages/cargoDetails.aspx">
</asp:MenuItem>.......

View 3 Replies

Web Forms :: Align Menu Items In Menu Control?

Jun 22, 2012

how to align the menu bar with proper space

View 1 Replies

Web Forms :: Use Pop Up Menu (instant Of Menu Control)?

Aug 17, 2010

How to use pop up menu (instant of Menu control)? can you give me some instruction.

View 2 Replies

VS 2013 ASPX Menu - Dynamically Adding Items Display Outside Menu Control

Apr 24, 2015

I have placed an aspx menu control on my master page with orientation as Horizontal. Below is HTML markup.

HTML Code:
<asp:Menu ID="mnuMedChem" runat="server" Orientation="Horizontal" Width="100%" OnMenuItemClick="mnuMedChem_MenuItemClick">
<DynamicHoverStyle CssClass="DynamicHover" />
<DynamicMenuItemStyle CssClass="DynamicMenuItem" />

[Code]....

I have tried populating the menus from my database by using the

Code:
mnuMedChem.Items.Add
and
Code:
mnuMedChem.FindControl(value).ChildItems.Add

The menu items and the childs are populating correctly but then the menu is not being displayed on the menu control.

View 4 Replies

What CSS Rules Do The Menu Server Control Implement To Renders As A Horizontal Menu?

Oct 2, 2010

For the ASP.NET Menu Server Control whose RenderMode is set to "List", there is an "Orientation" property which decides whether the menu would render as a horizontal or a vertical menu. I have compared the two HTML source code and was unable to find out which part of the HTML/CSS code set the orientation of the menu(unordered list).

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved