Computer Science Canada menu in asp.net with css troubleshooting |
Author: | unoho [ Fri Jun 17, 2011 1:44 pm ] | ||||
Post subject: | menu in asp.net with css troubleshooting | ||||
Hey guys, so i am trying to make a website where it will have few menus at the top but problem i got into is that my css is not working with the menu. i got the original css from a template file and i am trying to use that on my site by copying the css over to my css file. I have attached a copy of what i am trying to achieve. any idea/tips/comments/help is always appreciated. thanks
and my asp.net file is
|
Author: | 2goto1 [ Sat Jun 18, 2011 9:56 am ] |
Post subject: | RE:menu in asp.net with css troubleshooting |
What does the rendered html look like for the asp:menu tag? Can you paste your browser's source view? |
Author: | unoho [ Mon Jun 20, 2011 9:18 am ] | ||
Post subject: | Re: menu in asp.net with css troubleshooting | ||
hey sorry for the late reply..i didn't have access to the source code until today. here is the source view. i also attached a copy of how the menu looks like
|
Author: | 2goto1 [ Mon Jun 20, 2011 10:12 am ] |
Post subject: | RE:menu in asp.net with css troubleshooting |
It looks like from the rendered HTML, that there is a <table class="menu NavigationMenu_2">. Your CSS rules look like they're defined as div.menu. Were you intended the styles for div.menu to apply to the <table tag that has the class menu? If so, they won't apply. You'd have to change your CSS rule to table.menu for that to happen. All of the CSS selectors that you have from your first posting (div.menu, div.menu ul, div.menu ul li a, etc.) won't apply to the rendered HTML as is. Also the CSS rules from your first posting assume ul and li tags, whereas your rendered menu uses HTML table tags. You'll have to change your CSS rules to apply to your HTML structure |
Author: | unoho [ Mon Jun 20, 2011 11:21 am ] |
Post subject: | RE:menu in asp.net with css troubleshooting |
ya tht's the problem. how is the table being generated while i am clearly using div tag.. ughh |
Author: | 2goto1 [ Mon Jun 20, 2011 12:56 pm ] |
Post subject: | RE:menu in asp.net with css troubleshooting |
The <asp:Menu server tag renders as an HTML table. Since you're only rendering a Home and an About menu item, if you're planning to just have those 2 menu items, there's really no need/benefit to use asp:menu, unless you want the benefit of the correct menu item getting dynamically selected with a 'class="selected"' or something like that. But that's easy enough to hardwire for small websites. I'd just hand code the menu in HTML in that case. For larger menus or more dynamic requirements there are other menu controls that are more lightweight. |
Author: | unoho [ Mon Jun 20, 2011 1:33 pm ] |
Post subject: | RE:menu in asp.net with css troubleshooting |
ya i used those 2 for just an exam. it's supposed to be more dynamic.. like update a criteria in the database and menu would get updated automatically. EDIT: okay..this is very weird.. it renders fine when i do it in vs2010 but it wudn't work on vs2005 ,,, i guess it depends on how they render objects |