.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to left allign menu items in a menu centralized using div

Posted By:      Posted Date: September 25, 2010    Points: 0   Category :ASP.Net

I have a menu control in asp.net 3.5.  The menu control is centralized in the page using a div. I have written CSS to align menu items to the left... In IE8, the menu items also appear centrally alligned.  However in firefox the menu control is correctly aligned to the centre where as the menu items are aligned to the left.  I want the menu items to be alligned left while the menu control allign to the centre of the page in IE too...

Thanks in advance.


View Complete Post

More Related Resource Links

Menu items of Welcome control behaves incorrect in non-IE browsers.


We are using wss 3.0 sp2

I am referring to the welcome control that is part of standard sharepoint pages. This is the in the masterpage. The welcome contrrol has options such as 'sign-in as different user' , 'signout' and so on. When user takes the mouse and tries to click on the sub-menu it doesn't work as if the menu item is not getting focussed (however up/down arrow with keyboard works fine). 

I know that sharepoint sites are not best when viewed with firefox, safari, chrome etc  but is there a fix for this? Is it do with 'z' index setting or something? Can this be fixed through javascript?  

Please share your views/solution.


How to Make CSS for Hyperlinks NOT Affect Menu Items


VWD 2008 Express.

I have the following CSS in my DefaultStyleSheet.css file.  I want this to only apply to text hyperlinks (like links to web sites or email addresses) but NOT to my asp:menu items.  I am finding that although I have defined my asp:menu items in the menu properties, the colors in the text in the menu tabs get overridden by the CSS below.  How can I make this not happen?  Thanks for any help.


{color:#6F928B; text-decoration: none}


{color: #660066;}


Menu with Static and Dynamic Menu Items

I need to populate a menu with static and dynamic (at runtime) menu items.  I know this issue has been posted before, but I haven't seen anything with a date newer than 2009. This is what I want to do: <Menu> <Menu.ItemsSource>                     <CompositeCollection>                      <MenuItem Header="Menu Item 1" /> <MenuItem Header="Menu Item 2" /> <MenuItem Header="Menu Item 3" />                         <CollectionContainer Collection="{Binding MyMenuItems}" />                     </CompositeCollection> </Menu.ItemsSource> </Menu>   The posts every where say the issue is that CompositeCollection is not freezable.  Regardless of that arguement, has anyone come up with a good solution.  I don't want to create it all in code behind because it is a decent size menu with separators, etc.  This seems like something that should have been fixed or have a decent work round by now.   Thanks. 

Customize SharePoint Library Menu Items

Hi, In a library with file, the menu items available for any file is: View Properties, Edit Properties, Manage Permissions, Edit in <ApplicationName>, Delete, Send To, Check Out, Workflows, Alert Me . Now, I want to get rid of Edit Properties, Manage Permissions, Edit in <ApplicationName>, Delete, Check Out . Added to this is the need to remove the option in the Actions menu that states "Open With Windows Explorer " and finally the "Upload " menu is to go out. Any JScript for this or a file I need to edit to get this result? I need this because the business wants it out, its bordering on security. ThanksYou've only got one life; help as many people as you can, and enjoy it while it lasts.

collapsing the left menu as a default

 Hi! i have a menu on the left of the page which appears in the expandable form. I want to see them as the collapsed menu based on the site map group. I have posted the site map code and the master page here. Any idea please<?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode url="~/Default.aspx" title="Modules" description="Modules"> <siteMapNode url="~/Modules/Hire/Hire.aspx" title="Hire" description="Hire" resourceKey="HIR"> <siteMapNode url="~/Modules/Hire/Hire_Request_Navigator.aspx" title="Booking Request" resourceKey="HIR_REQ" description="Booking Request"> <siteMapNode url="~/Modules/Hire/Hire_Request_Detail.aspx" title="Request Detail" resourceKey="0" isPhantom="true"/> </siteMapNode> <siteMapNode url="~/Modules/Hire/Hire_Booking_Navigator.aspx" title="Booking" resourceKey="HIR_BOO"> <siteMapNode url="~/Modules/Hire/Hire_Booking_Fleet_Available.aspx" title="Booking Vehicle Selection" resourceKey="0" isPhantom="true"/> <siteMapNode url="

Menu Items for SPMenu

Hi All, I have developed application page which contains spgridview. And I have used SPMenuField for displaying menu items for files and folders. What my problem is, for both  files and folders I am getting same menu items. But I need to display different menu items for folders and files based on condition. How can I achieve this? Let me know if you have any queries. Regards, Kumar.

How To Space Menu Items Evenly

I'm using Visual Studio 2008. I have a asp menu in a cell in a table. The menu has 3 items as shown below This works fine however, how do you put more spacing (even spacing) bewteen the items? The items are too close together.   <tr>        <td>        </td>        <td>        <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal"                 style="margin-right: 8px">            <Items>                <asp:MenuItem Text="Home" Value="Home"></asp:MenuItem>                <asp:MenuItem Text="Solutions" Value="Solutions"></asp:MenuItem>                <asp:MenuItem Text="Contact" Value="Contact"></asp:MenuItem>            </Items>  

After building Installer - Items missing from Menu

Not sure if this is the best or correct forum so please excuse me and let me know where I should be posting my question, thanks. I have built my Windows Forms Application and it works fine... I now have to build an Installer project, which I have done with  reasonable success... EXCEPT FOR... The Menu Group and item do NOT appear in the Menu system.  The Desktop item appears correctly and the structure is there but no menu items appear.  I created the shortcut for the User's Desktop and User's Program Menu. (Using VS2008, C#, .NET 3.51, Access (DB), Forms, Installer project.) What am I missing SquireDude

Collect Menu/Submenu/Popupmenu items

Dear Sir, I am using VS2005 and SQL Server2000 I have a project where lot of Menu/Submenu/Popupmenu items. Now I want to have all Menu/Submenu/Popupmenu items in a list box of the project. I want to do this for create user access control to my project. so that selective group can access selected feature and Menu/Submenu/Popupmenu items. How can I do this ?????? / or is there any other way to control this access????

Is it possible to disable context menu items based on the selection on Treeview

I will have some sort of nodes for a treeview as follows Root |-> some.txt(A text file which was added at runtime) |->Child(child for some.txt) |-> child1(child for child) I designed my context menu with some options as New and Remove What i need is when i righclick on Root, child or child i would like to disable the Remove option

Vertical Align Menu Items when RenderingMode=List


I am having problems getting my Menu Items to align vertically in the middle when I set my rendering mode = list.

aspx code

        <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" 
            RenderingMode="list" CssClass="AspNet-Menu">
                <asp:MenuItem NavigateUrl="#" Text="Menu 1" Value="Menu 1"></asp:MenuItem>
                <asp:MenuItem NavigateUrl="#" Text="Menu 2" Value="Menu 2"></asp:MenuItem>
                <asp:MenuItem NavigateUrl="#" Text="Menu 3" Value="Menu 3"></asp:MenuItem>

css code for list

/* MENU */

.AspNet-Menu ul li{ width:60px; height:30px; background-color:Silver; vertical-align:middle;}
.AspNet-Menu ul li a
	color: Red;

But if i set the rendering mode to table it works fine...

aspx code

        <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" 
            RenderingMode="table" CssClass="AspNet-Menu">

Navigate Menu asp Control Add Items (HOW?) c#


I feel like a complete idiot!! :)

I have a asp.net menu control on a default.aspx page

I want to add items to this menu control using the code behind file (C#)

How do I do this?

My menu id is mnuHeader

YES, newB question .. LOL


Thanks for your help in advance!!! 

Dynamically Generated Dynamic Menu Items Width Question


I have the following Menu:

<asp:Menu ID="MainMenu" runat="server" Orientation="Horizontal" 
	DynamicVerticalOffset="2" DynamicHorizontalOffset="2" 
	StaticEnableDefaultPopOutImage="false" DynamicEnableDefaultPopOutImage="false" >
        <StaticMenuItemStyle BackColor="#0099cc" ForeColor="#eeeeee" Font-Names="Arial" Font-Size="11" Height="18" HorizontalPadding="10" VerticalPadding="3"  />
	<StaticHoverStyle BackColor="#336699" ForeColor="#ffffff" Font-Names="Arial" Font-Size="11" />
	<DynamicMenuItemStyle BackColor="#0099cc" ForeColor="#eeeeee" Font-Names="Arial" Font-Size="10" Height="18" 
		HorizontalPadding="10" VerticalPadding="3" />
	<DynamicHoverStyle BackColor="#336699" ForeColor="#ffffff" Font-Names="Arial" Font-Size="10" />					
		<asp:MenuItemBinding DataMember="Item" TextField="Title" />
		<asp:MenuItemBinding DataMember="SubItem" TextField="Title" />						

How to show left menu and center of page contents in an ASPX page?


Scenario : Within sharepoint site user will click on a hyperlink which should take him to a new page and this new page will have the same header/footer (so I will create a copy of the masterpage with just header,footer) but the left side menu navigation will dynamically change and for each click event within the menu, the center of the page will show varying texts plus videos.

Need some directions as how I can acheive the above? What should I use to build menu control and similarly how to control the center text of the page.  

Can I acheive the entire above using webpart and if so how? Do I need to use user control for menu and for center text display webpart ? or else any other best options?  

Please suggest.

submenu of main menu should come in the left side of everypage


I am using asp.net Menu control with sitemap datasource. There is one Web.sitemap in the folder where links are saved in such a manner

<siteMapNode url="~/MainMenu.aspx" title="Software Development Solutions" description="Software Development Solutions" >

      <siteMapNode url="~/submenu.aspx" title="CRM Software Application Development" description="CRM Software Application Development" />

     <siteMapNode url="~/submenu.aspx" title="CRM Software Application Development" description="CRM Software Application Development" />
<siteMapNode url="~/submenu.aspx" title="CRM Software Application Development" description="CRM Software Application Development" />


One asp.net page as i m using asp.net menu control. i want when MainMenu is clicked all the sub links of that menu should be come in the left side of the page.

Items from one menu into another menu


I have a menu stored into a session variable (for faster loading compared to retrieving all the information from the database all the time).

I need to take the items (which are in hierarchical order) and bind them to my pre-made menu on the page.

I tried doing all the following and none worked...

menu.Items = sessionmenu.Items
menu.datasource = sessionmenu.datasource
menu = sessionmenu

Any help would be wonderful.

How to create a webpart page with a site menu on the left?



This might be another novice question but i really googled and searched this site and didnt find any answers (even though topics close to this are discussed, this one isnt).

Scenario: I have a webpart i wrote that shows people who has birthday and provides sorting tools (in exact month/ exact day/ name contains string). This webpart has to be displayed as the page's content (in the center, its ~900px wide). This page must have the site menu on the left as well so users can navigate freely.

I tried to create a new webpart page in MOSS and successfully placed the webpart there, but the page wont have the left site menu.

I need that left menu!

I tried creating a web page from a template with a strip (sorry cant find better word to explain that) on the left but that strip only allows to add more webparts, and doesnt allow to show the menu there.

How do i show the website menu (the one with links to Tasks, Lists, Users etc, the one that always shows itself on the /sites/sitename/ page and when viewing Lists) on my web part page?

Or do i have to go other way, meaning, not by using a web part page, but with some other way, like create an aspx page or something?

Please help.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend