Tracking Forums, Newsgroups, Maling Lists
Home Submit Tracker Forums
  Advanced Search
  HOME    TRACKER    ASP.NET


Advertisements:










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 :: Maintain Selected Item Style In Menu Control After Redirecting Page?
I had added one static menu in my master page. on each menu item click i am redirecting page to corresponding link mentioned in the menu navigate url property. What happening is i had one selected item style. if the page simply post back selected item style will work. but if do redirect the page to another page selected style won't working.

Posted: Sep 04, 2009 05:17 AM

View 4 Replies!   View Related
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 :: Menu Control Click Event Not Firing / How To Pass The Selected Menu Item Text To The 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:07 PM

View 1 Replies!   View Related
Web Forms :: Menu Control Dynamic Item Display Style Horizontal?
My menu control is in horizotal style andi want to show it's dynamic itemalso in horizontal style too, by default they are vertical. Plus the arrow(Static pop-out image)to be shown vertical rather horizotal which is by default. How to do that ?

Posted: Mar 21, 2010 10:50 AM

View 3 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 menushows 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 withStaticSelectedStyle 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 :: Create Menu On Main Page, Control And Open Child Form, On Clicking On The Menu Item?
I want to create menu on my main page, and control and open my child form, on clicking on the my menu item. how to create and control menu.

Posted: Oct 31, 2009 12:54 PM

View 3 Replies!   View Related
Web Forms :: Changing Style Of Each Menu Item?
I want to change each items color in the asp menu control while the menu is generating dynamically from a database.

i.e. 1st item's background color is yellow and 2nd item's background color is red and so on.

Posted: Feb 14, 2010 01:00 PM

View 2 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 :: Changing Style Of Each Menu Item In Navigation
I need to change the background color of each menu item of asp menu control while the menu items are populate dynamically using a database. i.e. 1st menu item in black background, 2nd in green and 3rd in red and so on. If you can explain using C# it is great.

Posted: Feb 14, 2010 01:08 PM

View 2 Replies!   View Related
How To Highlight The Selected Menu Item
I have a asp menu in my master page and i need to highlight the selected menu item.

Posted: Feb 01, 2011 09:53 AM

View 1 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 :: How To Menu Selected Item Hilight
i am using asp:menu for showing the menus in masterpage. If i click the menu item 1, the corresponding page is loading in the content page. I need that the selected Menu item should be highlighted by some color.

[code]....

Posted: Mar 02, 2011 07:52 AM

View 2 Replies!   View Related
Web Forms :: How To Highlight The Selected Menu Item
I have one asp leftmenu control in my project.when I select one menu item of menu control that Should be highlight.

how to highlight the selected asp menu item?

Posted: Aug 12, 2010 06:21 AM

View 8 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 :: How To Set A Selected Dynamic Menu Item To False
Does anyone know how to set a selectedasp.net dynamic menu item to false? I have multiple menus and when someone selects an item from one of the dropdown menus it changes color. If I were to select an item from a different menu I need the other menus not to have the selected option anymore.

Posted: Feb 10, 2011 01:43 PM

View 1 Replies!   View Related
Maintain The Color Of Sub Selected Item In Accordion Menu?
How to maintain the color of sub selected item in accordian menu

Posted: Apr 12, 2010 09:55 AM

View 1 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 aselected 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 whatto 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
C# - How To Pass Command Argument While Selecting A Menu Item In System.Web.UI.WebControls.Menu
I have a Menu. When user clicks on the menu , I need to pass a command argument. How is that done ?

This is the code for

[code]....

Posted: Feb 2 at 6:27

View 2 Replies!   View Related
Hide The Menu Item On Page Load And Show The Item After The Event Is Triggered?
I am using aspnet menu control and i want to hide the item initially on page load and show the item after an event is trigger say button lick event Can any one give me an example?

Posted: Mar 24, 2011 09:47 PM

View 6 Replies!   View Related
Web Forms :: How To Build A Menu And Each Item Of The Menu Has An Image As Background
I am need to build a menu and each item of the menu has an image as background knowing that i depend on sitemap to build the menu i used

[Code]....

where menuitem is in a css sheet

[Code]....

it display the image but in the wrong place?

Posted: Apr 19, 2010 03:39 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 whichstated that...

"This screenshot demonstrates some of the styling options provided by the CSS, including the style for the selected About menu item"...In thescreenshot 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 :: Changing Background Color Of A Selected Menu Item That Exists On Sitemaster
I am trying to show the user of my application that when they click on a menu item that their selection gets shown by changing the background color of that menu item

I am using the default menu that comes with asp and is contained in the site master. the default CSS for the menu has a hover and active properties but only the hover works.

Posted: Aug 10, 2010 11:58 AM

View 11 Replies!   View Related
Web Forms :: Need To Create The Menu And Menu Item At Runtime?
How can I bind a menu item at runtime?

I need the menu item with name "pack" to call Packer.Run();

But I need to create the menu and menu item at runtime.

Posted: Nov 20, 2009 01:17 AM

View 2 Replies!   View Related
Web Forms :: How To Remove Menu Item Or Sub Item By Value
I have an asp.net menu in which i have to let some nodes visible or invisible base on some logic.I know i can find value by item but i wnated to FindItemByValue of my asp.net menu.Could it be possible?

Posted: Sep 20, 2010 07:13 AM

View 3 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 :: Unable To Get The Sub Item In Menu Control?
my code is like this.

<%

@
Page
Language="C#"
</form>body>html> [code].....

when i open in the browser it is like below.

Posted: Dec 18, 2009 10:49 AM

View 4 Replies!   View Related
Web Forms :: Menu Control ... Cannot Select Item At 4th Level
I have thiscontrol on a page. The selections are static. The "maximumlevels" is set to 6. When I click on an itemat the 4th level, I can see the postback occur but the "click" event doesn't fire! I'm totally baffeled. I've tested thisin the Page Load event. At this point the PRIOR menu selected value shows. On the next menu_click, the previous selection shows. Thefirst 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 andon click, I can see the prior menu item value. When Iclick 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
Web Forms :: How To Programmatically Control Individual Menu Item Visibility
I would like to programmatically hide/unhide Individual Menu items.

How is this best accomplished. I see thatintellisense does not havea visibility attribute for Menu1.Items(1).

Posted: Nov 05, 2010 05:50 PM

View 4 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 theissue.. When we click anymenu item, the corresponding menu item is highlighted.

Posted: Jul 13, 2010 04:23 AM

View 1 Replies!   View Related
Web Forms :: How To Get A Reference To A Control Inside A Menu Item Template From Code Behind In The MenuIt...
I have this menu control and in theMenuItemDataBound event I need to get a refrence to a control that is inside theStaticItemTemplate of the menu control.

I need to get a reference at load time to the control in each menu item

Posted: Oct 14, 2009 07:09 PM

View 1 Replies!   View Related
Web Forms :: Unable To Get The Selected Style Css In Menu Items When It Is Selected
i am not getting the selected style css in menu items when it is selected

it will work if i will remove the navigate url but i need to use the navigate url as i am having the menu in master page

[code]....

Posted: Oct 24, 2008 09:30 AM

View 5 Replies!   View Related
Forms Data Controls :: Add A Context Menu Strip For A Grid View Control On Right Click Of The Item?
I want to know how to add a context menu strip for a grid view control on right click of the item..

Posted: Oct 08, 2010 05:18 AM

View 3 Replies!   View Related
Copyright 2005-08 www.BigResource.com, All rights reserved