Menu Control - One Menu Item Should Be With Selected Item Style?
i have added 5 menu items in my menu control dynamically from database.when i click Item1 it redirect me to Page1 and Item1 color changes to selected.when i click Item2 it redirect to Page2 and Item1 color changes to selected.But still Item1 colors is selected. I just want only one menu item should be with selected item style....
View 3 Replies (Posted: Mar 5 09)
Sponsored Links:
Related Forum Messages For ASP.NET category:
Web Forms :: Menu Top Level Selected Item Style?
I want to apply a css class to the level 1 menu item (parent) when it or any or it's children are selected. I've looked at MSDN documentation and any number of examples and walkthroughs but I haven't come up with a way of managing this. I was thinking something like this might work but the style is not being applied to the parent. To further complicate matters, if I try to apply a css style to StaticSelectedStyle it doesn't pick it up at all. Menu Markup: <StaticSelectedStyle Font-Bold="True" ForeColor="#3333CC" /> Code Behind: protected void MenuItemClick_NavMenu(Object sender, MenuEventArgs e) {menuItem parentItem = e.Item.Parent; if (parentItem != null) { parentItem.Selected = true; }
Posted: Aug 22, 2010 10:10 PM
View 2 Replies!
View Related
Web Forms :: Keep The Top Menu Item Selected / Always Select The First Sub-menu?
I want a two level menu: The top menu shows the main areas in the site, the second level shows the sub menu items. I have sort-of done this in the following way: [Code].... And the site map is like this: [Code].... My two questions are this: 1) When I select a sub menu item, how can I keep the top menu item selected? 2) Then I select a top-menu item, I would like the first sub-menu item to be selected by default. For example: [code]....
Posted: Aug 18, 2009 02:18 PM
View 1 Replies!
View Related
Css - Menu Control - Keeping Parent Item Selected?
I have two ASP.NET Menu controls on a page. One in my header (tabs) for top level pages, e.g. ~/Default.aspx And one in my sidebar for sub pages, e.g. ~/Products/SomeProduct.aspxI'm using the selected CSS class to ensure that the selected tab is a different colour.Works fine for top level pages, but if I view a sub page, the tab isn't assigned a CSS class of selected.How can I ensure that the top level menu item has a CSS class of selected when viewing a sub page?
Posted: Jul 22 10 at 10:40
View 1 Replies!
View Related
Javascript - Hide Menu Item Or Dropdown Menu Item?
I have dropdown menu item ("pin this site") that i need to hide it or hide menu item itself ("My Network"). When I saw viewsource on page, I got below code. <a class="zz1_TopNavigationMenu_1 ms-topnav zz1_TopNavigationMenu_3 ms-topnavselected zz1_TopNavigationMenu_9" href="http://mynetworkqa.spe.org" style="border-style:none;font-size:1em;">My Network</a> <a class="zz1_TopNavigationMenu_1 ms-topNavFlyOuts zz1_TopNavigationMenu_6" href="javascript:__doPostBack(, 'ctl00$PlaceHolderTopNavBar$PlaceHolderHorizontalNav$topSiteMap''Pin')" style="border-style:none;font-size:1em;">Pin this site</a> How can I hide menu item?
Posted: Aug 31 10 at 20:36
View 1 Replies!
View Related
Web Forms :: Highlight Clicked Menu Item On Menu Control
In the MasterPage i am using a menu control and it works fine, code behind is in masterpage.master.vb .Currently i am binding the menu directly from database My problem is that while clicking on the menu the clicked menu item is not highlighting. I tried with StaticSelectedStyle and DynamicSelectedStyle but no effect. The menu control code is as followes <asp:Menu Width="165px" ID="Menu1" runat="server"> <LevelMenuItemStyles> <asp:MenuItemStyle CssClass="MyDMenu"/> </LevelMenuItemStyles> <StaticHoverStyle CssClass="hoverstyle"/> <StaticItemTemplate> <%# Eval("Text") %> <%--<asp:Label runat="server" ID="lbItmCount">[<%#Eval("ChildItems.Count")%>]</asp:Label>--%> </StaticItemTemplate> <StaticSelectedStyle BackColor="CadetBlue" /> </asp:Menu> MasterPage.Master.vb code is as followes Sub BindMenu() Dim connectionString As String = WebConfigurationManager.ConnectionStrings("DatabaseConnectionString1").ConnectionString Dim con As New MySqlConnection(connectionString) Dim dadCategories As New MySqlDataAdapter("SELECT SubCategory_id,Category_id,SubCategory_desc FROM subCategory where Category_id = '2'order by SubCategory_desc", con) Dim dsCat As New DataSet() Using con con.Open() dadCategories.Fill(dsCat, "category") End Using Dim count As Integer = 0 For Each categoryRow As DataRow In dsCat.Tables("category").Rows Dim mNode As New MenuItem(CType(categoryRow("SubCategory_desc"), String), "", "", "~/items.aspx?pid=" + CType(categoryRow("SubCategory_id"), String), "_parent") Menu1.Items.Add(mNode) Next count = count + 1 End Sub
Posted: Nov 14, 2009 12:02 PM
View 1 Replies!
View Related
Web Forms :: Finding Menu Item From Menu Control?
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>.......
Posted: Apr 15, 2010 12:59 PM
View 3 Replies!
View Related
Web Forms :: Menu - How To Keep An Item Selected
I have a Menu in a custom class (ascx) which I use throughout my site. I would like to show which item in the menu the user has selected. This works fine until a menu selection navigates to another page in my site. What is the best way to maintain the 'state' of my menu as the .ascx gets reloaded? Should I use properties on the ascx and then when the ascx is reloaded I set those properties?
Posted: Sep 01, 2009 02:53 PM
View 6 Replies!
View Related
Web Forms :: Setting Menu Selected Item From Code Behind?
I have a master page (Site.master) with a navigation menu linked to a datasource (Master.sitemap). I have a nested master page that has another navigation menu. For any item clicked in this nested navigation menu, I want a particular menu item in the Site.master navigation menu to be selected. Here's my Site.master menu: [Code].... In my Site.master.cs I have this: [Code].... In the nested master page, Products.master I have this: [Code].... In the Products.master.cs file I try to change the selected item. [Code].... The master navigation and products navigation menus work just fine by themselves. But when I've tried to set the selected item of the master menu in the Page_Load above, I can't seem to access it. What I've found in trying to do this is the NavigationMenu seems to be uninitialized. The menu Items list is empty. What am I missing here? Why are there no menuItems in the Master.NavigationMenu control?
Posted: Nov 10, 2010 02:42 AM
View 2 Replies!
View Related
Web Forms :: Retrieve Current Selected Menu Item Into Label
I'v been looking for ages on how to get the current selected menu item into a label. so for example on the menu you have home and about, if i click on about it will but the text "About" in the labels text whats in the body of the form. You could say its a sub heading and i would like to do this in c# ;) somthing like this: lblHeading.Text = Menu1.Page.Title.ToString(); except this retutns the tabpage title not the actual menu item i selected.
Posted: Feb 17, 2010 01:10 AM
View 1 Replies!
View Related
Web Forms :: How To Change The Background Color Of A Selected Menu Item
how to change the background color of a selected menu item? The background color changes on the word of the dropdown menu but not the entire row section of the menu item. Each menu item has a different word length but I want the background color length to be consistent throughout the dropdown dynamic menu. I also what to change the background parent when a menu item is selected.
Posted: Feb 10, 2011 07:56 PM
View 1 Replies!
View Related
Web Forms :: Programmatically Set The Selected Menu - Item When Using Sitemap Datasource
I have a nested master-page szenario: content.aspx - subsite.master - site.master. The site.master contains a Menu-control with a SiteMapDataSource. Problem 1 (solved): I don't want to display all the nodes in this menu cause some nested nodes should be displayed in the menu in subsite.master. Therefore I use MenuItemDataBound to remove the unwanted nodes. => Problem 1 solved Problem 2 (solved): I want to maintain the selected element of the Menu in site.master when the user is navigating with the sub-menu in subsite.master, so he is calling different .aspx sites. Therefore created a property in the site.master which is set by the aspx sites. [Code]....
Posted: May 24, 2009 11:34 PM
View 1 Replies!
View Related
Web Forms :: Pass Selected Menu Item Text To Other Page?
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?
Posted: Jan 10, 2011 02:20 PM
View 1 Replies!
View Related
Web Forms :: Menu Collapses Automatically When Click On A Menu Item?
i have a menu which is collapses as a default. This is done by following query. [Code].... Now, the problem is, whenever i click on any menu item by expanding the menu, the item page opens but the menu collapses again. I want to let the menu remain as expanded although a menu item is clicked. i.e. menu shouldn't refresh when a menu item is clicked.
Posted: Feb 21, 2011 03:42 AM
View 6 Replies!
View Related
Web Forms :: Default Web Template In Visual Studio 2010 Selected Menu Item CSS?
I tried using the the New ASP.NET Default Web Template in Visual Studio 2010 but one issue I'm encountering is with the CSS selected menu item and read apost which stated that... "This screenshot demonstrates some of the styling options provided by the CSS, including the style for the selected About menu item"...In the screenshot the "About Us" menu item is highlighted but the page's content is the "Home" page content, not "About Us" page. My problem is...I can't get the selected item to be highlighted as in the screenshot even with fresh site using the built in template.
Posted: Jun 22, 2010 07:21 PM
View 6 Replies!
View Related
Web Forms :: Style The Menu Control To Allow The Menu Items To Float To The Right Of The Container?
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]...
Posted: Feb 03, 2011 04:21 AM
View 5 Replies!
View Related
Web Forms :: Menu Control ... Cannot Select Item At 4th Level
I have this control on a page. The selections are static. The "maximumlevels" is set to 6. When I click on an item at the 4th level, I can see the postback occur but the "click" event doesn't fire! I'm totally baffeled. I've tested this in the Page Load event. At this point the PRIOR menu selected value shows. On the next menu_click, the previous selection shows. The first menu item is "selected" and has a value of "Overview". The fourth level item has a value of "Child". No matter how many times I selected that item, my check in the Page Load shows the value to be "Overview". I've tested the 3rd level items and on click, I can see the prior menu item value. When I click a 4th level item, the value never changes from the last 3rd level or higher item selected.
Posted: Nov 08, 2010 04:33 PM
View 7 Replies!
View Related
Forms Data Controls :: Menu Control Item Is Not Highlighted After Select?
I am facing one problem regarding asp.net menu control ' see this link http://202.88.239.14/lv/UI/Audios.aspx?ServiceType=1 In that we added a menu control in the left side for category.Loading this control using XMLData source I have added the code below [Code].... In tha XML data source transform file is a xslt file so coming back to the issue.. When we click any menu item, the corresponding menu item is highlighted.
Posted: Jul 13, 2010 04:23 AM
View 1 Replies!
View Related
|