Solved

Formatting an ASP.Net Menu Control

Posted on 2014-02-16
4
818 Views
Last Modified: 2014-03-07
This is my first attempt at building a website . . . I'm using ASP.Net.

Thus far I've done some simple HTML and CSS to create a header bar along the top containing the site logo on the left and a horizontal ASP.Net menu along the remainder. I populate the menu items and child items at runtime from a dataset of parent-child tables from a SQL Server database. So far OK, I can glide left to right over the menu items with my mouse and the subitems drop down below as expected, but I don't know how to progress from here as regards fine-tuning its behaviour and formatting.
0
Comment
Question by:TimHudspith
  • 2
4 Comments
 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 200 total points
ID: 39863805
There are different approaches that you can take with the styling of the Menu control.

Here is an article that talks about using CSS and styling properties:

Using CSS and Styles with the Menu Control
http://msdn.microsoft.com/en-us/library/ms366731.aspx

The exact usage depends on your requirements.
0
 
LVL 7

Accepted Solution

by:
Kishan Zunjare earned 300 total points
ID: 39866566
Database Driven Dynamic Menu Control with CSS and formatting.

http://www.codeproject.com/Tips/526004/Database-Driven-Dynamic-Menu-Control

Hope this helps
-Kishan
0
 

Author Comment

by:TimHudspith
ID: 39869492
Thanks for the links. My menu looks just like the one shown in the CodeProject link - one static horizontal layer with three dynamic vertical submenus, each appearing to the right of the parent. One drawback of this control is that it does not allow you to style individual menu items, but I've done a workaround by giving certain items an identity using the href attribute, which I then style with CSS classes that target the href value.

The problem I have is on the right-hand side of the menu bar. There is no room to show the last two submenus, so I want to push them left of the parent, not to the right. So I need to create a style for the <ul> element containing these items. I looked at the markup rendered in the browser to find the ID of the <ul> tags, then created an external style with that selector to override the auto-generated inline style (using '!important'), but it won't override.
0
 

Author Comment

by:TimHudspith
ID: 39911863
In the end I gave up with the ASP menu control. The amount of CSS manipulation it allows is so limited it's pretty much useless.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question