Web Forms :: Display Menu Control Items Like Table Without Setting Rendering Mode?
Mar 2, 2011
I hate tables - don't want to use tables, unless I have tabular data to display. A menu is not tabular data (as far as I am concerned.) I was elated to see that in asp.net 4 - the menu control renders as a <ul> <li>, instead of as a table. However - try as I might, I can not get a horizontally orientated Menu to split into even columns, and text align center. FYI - I don't use fixed width - so I can't just set a width to 1000 - and separate it into even columns. Besides that, I want it to change width dynamically, based on the number of "columns (menuItems)" there are. Is it possible to spread out the <li> menu items evenly across the space I provide for them in their containing div or will I have to quite using menu controls, and start using JQuery Menu's?
View 2 Replies
Similar Messages:
Mar 1, 2011
I've migrated a test site to asp.net 4.0 to take advantage of the list renderingmode for a menu. Having the UL and LI should be easier than the table rendering.I'm making progress, (still have work to do, just ignore the odd border) however one issue continues to plague the testing. IN IE 6,7,8, as the page is rendering, it appears the menu is flickering and trying to render as a vertical menu instead of the correct
orientation which is horizontal. In Moz, Chrome, Sarafi, Opera, I don't get this behavior.
The menu is styled with CSS however I'm not opposed to adding some corrective code directly to the masterpage that holds the menu. I'd apprecate a suggestion as to how to solve this because as it is, it is not usable.Here is the link to the test site.
http://testbeachcrab.net.serv7.temphostspace.com/default.aspx
View 5 Replies
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
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
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
Jun 22, 2012
how to align the menu bar with proper space
View 1 Replies
Jul 28, 2010
I am testing my website in numerous browers and have discovered (amazingly) that the asp:menu
control does not render properly in both the above browsers! Given that these browsers must account for
a large part of internet traffic it is curious that microsoft have not fixed this. I have looked at CSS Friendly but
if looks like a lot of work and change for my websites just for the one control that does not work.
View 1 Replies
Sep 26, 2010
why the following code bombs with a NullReference exception.
[Code]....
I just want to output the html for the menu control to a string, if I remove the line that adds the new menu item or I change the control to a calander control instead of a menu control the it works fine.
View 7 Replies
Sep 21, 2010
I am having a problem with rendering a menu control inside a server control. I am getting an error in the RenderContents override method when I try to render the Menu Control. The error I am getting is an Object Reference error. The code is below...
[Code]....
View 7 Replies
Aug 22, 2010
I've encountered was appears to be a strange bug with the menu control, and alas, I am unable to find much useful information on it (which leads me to believe I have something installed or confingured incorrectly). Here the problem:
When declaring a menu control with a staticHoverStyle, for example:
<asp:Menu
ID="navMenu"
DataSourceID="srcSiteMap" [code]....
Has no effect on the behavior of the control once it's rendered, neither in Firefox nor IE.In fact, using the source code at
http://msdn.microsoft.com/en-us/library/ms366731.aspx with no modifications also results in the hoverstyle not working.
This problem seems to be "fixed" if you specify the css attribute declaratively, for example, StaticMenuItemStyle-BackColor="Yellow".
Alternatively, if you specify RenderingMode="table" then the hoverstyle seems to work. It's only when you're using a cssclass with a list that things seem to mess up.
Finally, I notice that in the rendered html, the control embeds some styles between /* <![CDATA[ */ and /* ]]> */ comments that affects the final appearance of the menu control, sometimes overwriting a cssclass you specified (ex: the margin for dynamic menus can only be controlled with the HorizontalOffset property, and not by css). This is undesirable, but I don't see anything that seems to overwrite the behavior of hover elements. Actually, the .hoveritem class doesn't appear anywhere in the markup at all, but when you specify the StaticMenuItemStyle-BackColor property, then the value is rendered correctly in this block of styles.
View 3 Replies
May 15, 2010
how can i fix my menu that is not showing a dynamic items... it only says "Expand ****"... suddenly that problem showed up... and also a skip navigation link showed too..
View 5 Replies
Jan 27, 2010
I am having a menu control with the horizontal orientation.
when the number of the menuitems increases the menu control is extending.
how to display the menu items in the next line and avoid the extending of the menu control.
View 4 Replies
Feb 22, 2010
I need a help in creating a vertical oriented Menu control with dynamic url's set in there Navigate Url property.Also i need to set the menu items as enable/disable in two different modes say edit/new.
View 1 Replies
Jul 10, 2010
I added a menu avigation control in my page and i did this:
<div style="background-color: Maroon">
<asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" ForeColor="Black" Font-Bold="true"
BackColor="Chocolate">
<Items>
<asp:MenuItem Text="Home"></asp:MenuItem>
<asp:MenuItem Text="About Us"></asp:MenuItem>
<asp:MenuItem Text="Services"></asp:MenuItem>
<asp:MenuItem Text="Careers"></asp:MenuItem>
<asp:MenuItem Text="Contact Us"></asp:MenuItem>
</Items>
</asp:Menu>
</div>
but i cant give proper spacing between the menu items right now it is appearing like this: how to give proper spacing between the menu items them?
View 14 Replies
Jul 13, 2010
I hv created menu using sitemap xmldatasource now i want to display that based on Category or Roles. I have Created 4 Category in my sql Server 2005. when particular user logged in based on his Category menu nodes should display.
View 7 Replies
Jan 4, 2011
I'm receiving the following error in DesignMode with the Accordion1 control. Not sure what is causing this. This is my ASP WebApp.Error Rendering Control - Accordion1 An unhandled exception has occurred. Collection was modified; enumeration operation may not execute.Any idea, what causes this error?Code VS 2005 Pro ASP Ajax XP SP3
View 3 Replies
May 1, 2010
I have a gridview with edit functionality and using the EditItemTemplate section. I am trying to set focus to a textbox when user selects the edit mode.
[Code].....
View 6 Replies
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
May 28, 2010
I'd like to disable the 'Refresh' option in the right-click menu for internet explorer. Our application uses Javascript, ASP.Net and VB, but I'm sure it'll need to be done through Javascript.
View 1 Replies
Aug 22, 2010
I have for example a ASP Menu control having a static (File) and dynamic (Open, New) menu such as :
[code]....
I am able to see this menu under VS 2008 under my development PC. But when I deploy the app to a IIS server, and run the app, the whole app appeared the same. Only the Menu has "File" for selection but the submenu items (Open and New) did not appear when the mouse cursor was moved over "File". Only the Outline of the dropdown box of the submenu appeared.
View 2 Replies
Aug 12, 2013
I have written code for menu with web.sitemap and SiteMapDataSource1.I want to hide the admin panel if user has no admin rights.
How there is relation between sitemapdatasource,web.sitemap and menu.
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false" />
<asp:Menu ID="Menu" runat="server" DataSourceID="SiteMapDataSource1" Orientation="Horizontal"
OnMenuItemDataBound="OnMenuItemDataBound" onmenuitemclick="Menu_MenuItemClick" Width="100%">
<LevelMenuItemStyles>
<asp:MenuItemStyle CssClass="main_menu" />
[Code] .....
View 1 Replies
Apr 25, 2010
I have a simple HttpHandler that generates a dynamic image based on query string parameters and a custom web control that renders an image tag pointing to the handler as its 'src' attribute. All works fine when run in the web server, but at design timethe control displays as the "missing image" icon (red x in a box). The handler is registered in the web.config with a ".ashx" extension. The RenderContents method in the control looks like this:
output.AddAttribute("src", ResolveUrl(string.Format("~/Sparklines.SparkHandler.ashx?stype=pm&w={0}&h={1}&sv={2}&ev={3}&cv={4}&sc={5}&ec={6}&mc={7}&gs={8}",
Width.IsEmpty ? 100 : Width.Value,
Height.IsEmpty ? 15 : Height.Value,
caleStart, ScaleEnd, CurrentValue,
ColorUtils.ColorString(StartColor, true),
[code]...
View 5 Replies
Aug 23, 2010
I'm trying to add a text-only item to a databound menu control. So far all I'm capable of doing is adding more links, but no text. My goal is to have a leading item be part of the menu but not a link. I want it to be displayed as text...
I've tried adding items to the menu.items collection, but this adds links.
I've tried adding items to the menu.controls collection, but this doesn't get picked up at all, just ignored.
View 1 Replies
Jan 28, 2010
i'm working with asp.net visual studio 2008 c#i'm using Menu and i added items . the first item has like sub-items ...now when i run the website, the Menu wont open the sub-items menu ... this is the code :
<li style="direction: rtl"> <asp:Menu ID="Menu2" runat="server" BackColor="WhiteSmoke" BorderColor="White" ForeColor="#6699FF" Font-Bold="True" Height="361px" Style="left: 2px; position: relative; top: -9px; background-color: #ffffff" Width="194px"> <Items> <asp:MenuItem
NavigateUrl="~/CourseSignUp.aspx" Text="קורסי גלישה" Value="קורסי גלישה"> <asp:MenuItem Text="קורס ילדים עד גיל 18" Value="קורס ילדים עד גיל 18"> <asp:MenuItem Text="קורסים בקיץ" Value="קורסים בקיץ" NavigateUrl="~/CourseSignUp.aspx"></asp:MenuItem> <asp:MenuItem Text="קורס ימי שישי" Value="קורס ימי שישי"></asp:MenuItem> <asp:MenuItem Text="קורסים בחגים" Value="קורסים בחגים"></asp:MenuItem> </asp:MenuItem> <asp:MenuItem Text="קורס מבוגרים" Value="קורס מבוגרים"> <asp:MenuItem Text="קורס ימי שישי" Value="קורס ימי שישי"></asp:MenuItem> </asp:MenuItem> </asp:MenuItem> <asp:MenuItem Text="שיעורים פרטיים" Value="New Item"> </asp:MenuItem> <asp:MenuItem NavigateUrl="~/Rents.aspx" Text="השכרות" Value="Rents"></asp:MenuItem> <asp:MenuItem Text="מידע לגולש המתחיל" Value="New Item"></asp:MenuItem> <asp:MenuItem Text="לי קים" Value="New Item"></asp:MenuItem> <asp:MenuItem Text="תחזיות" Value="New Item" NavigateUrl="~/Forecasts.aspx"></asp:MenuItem> <asp:MenuItem Text="מאמרים" Value="New Item"></asp:MenuItem> <asp:MenuItem Text="הסטורית גלישה" Value="New Item"></asp:MenuItem> </Items> </asp:Menu> </li>
View 3 Replies
Feb 26, 2010
Is there any way to prevent the asp:Login control from rendering a table around my controls? Rendered HTML: <div id="credentials">
View 12 Replies