Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 15th, 2012, 02:40 AM
Authorized User
Points: 303, Level: 6
Points: 303, Level: 6 Points: 303, Level: 6 Points: 303, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2009
Location: Connecticut, USA
Posts: 63
Thanks: 18
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Wilfredo Rosado
Default Menu items control

Hi Imar.

I noticed that in ASP.NET 4.0 the menu items are controlled differently than in ASP.NET 3.5, at least it seems that way. In 3.5 you talked in great detail on how to setup the menu items using properties. In 4.0 it is done with ULs. In 4.0 your discussion on setting UL menu items such as main menu background & forground colors, hover colors, and select colors was not as explicit as in 3.5. Llikewise in setting the colors and properties of the submenus.

Is there a source I can go to that explains in more detail how to set these menu features? I was able to set the menu features following your 3.5 instructions, but I'm having trouble setting them in 4.0 and there isn't much to go on in your book. Is there another book I can obtain that talks more about CSS in ASP.NET 4.0? Specifically menu controls. Or did I miss something?

There are a few things about menus that are bugging me right now:
  1. If I put the main menu bar horizontal on the bottom, which I have without a problem, is ther a way to make the submenu pop upward instead of down?
  2. I can't seem to get the character color in the main or submenus to be what I want them to be. They come up purple and stay that way.
  3. I am able to set the main menu and hover background color as well as the submenu background colors, but that is all.
  4. I am able to set the selected character color on main menu, however when I click on a submenu item the submenu item does change to the selected color, but the main menu option that holds the submenu options looses its character and background color.
I will check again to insure I type that section in correctly, but in the meantime here is my CSS file with the menu options in red character color:
Code:
body
{
  margin:  0;
  padding: 0;
  background-color: #ECFFED; 
}

*
{
  font-family: Arial;
}

.treestyle
{
  width: 769px;
  height: 494px;
}

.headerText
{
  font-family: Algerian;
  font-size: 40px;
  font-weight: bold;
  text-align: center;
  margin: 0;
}

#PageWrapper
{
  margin: 0 auto;
  width: 844px;
}

#Header
{
  background-color: #ffffff; 
  color: #2C7421;
  width: 844px;
  height: 45px;
}

#MainContent
{
  background-color: #ffffff;
  background-image: ~/Images/Tree.jpg;
  width: 844px;
  height: 540px;
  text-align: center;
}

#MenuWrapper
{
  font-family: Algerian;
  color: #2C7421;
  background-color: #ffffff;
  width: 844px;
}

#Footer
{
  color: #2C7421;
  background-color: #ffffff;
  width: 844px;
  clear both;
}

ul.level1
{
  font-family: Algerian;
  font-size: 14px;
  font-weight: bold;
  height: 19px;
  line-height: 19px;
  color: #008000;
}

ul.level1 .selected
{
  background-color: #bcd1fe;
  color: #008000;
}

a.level1
{
  margin-left: 5px;
}

a.level2
{
  background-color: #cccccc;
  padding-left: 8 px;
}

a.level1:hover, a.level2:hover
{
  background-color: #bcd1fe;
}
Here is my web.sitemap code just in case:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode url="~/" title="Welcome"  description="Welcome to The Family Tree">
        <siteMapNode url="~/Default.aspx" title="Welcome"  description="Go to the homepage" />
        <siteMapNode url="~/About/About.aspx" title="About Us"  description="Help and Information about us">
          <siteMapNode url="~/About/ContactUs.aspx" title="Contact Us"  description="Leave us a message" />
          <siteMapNode url="~/About/Help.aspx" title="Help"  description="Obtain help" />
        </siteMapNode>
        <siteMapNode url="~/Tree/Search.aspx" title="Search Tree"  description="Search candidates in Family Tree">
          <siteMapNode url="~/Tree/Person.aspx" title="By Person"  description="Search a candidate in Family Tree" />
          <siteMapNode url="~/Tree/couple.aspx" title="By Couple"  description="Search for married couple" />
          <siteMapNode url="~/Tree/roots.aspx" title="By Roots"  description="Search for your roots" />
        </siteMapNode>
        <siteMapNode url="~/Add/Add.aspx" title="Add Candidate"  description="Add candidates to Family Tree">
          <siteMapNode url="~/Add/person.aspx" title="By Person"  description="Add a person into The Family Tree" />
          <siteMapNode url="~/Add/Couple.aspx" title="By Couple"  description="Add a married couple into The Family Tree" />
        </siteMapNode>
        <siteMapNode url="~/Control/Panel.aspx" title="Control Panel"  description="Maintain Family Tree">
          <siteMapNode url="~/Control/Enter.aspx" title="Enter"  description="Enter a candidate into The Family Tree" />
          <siteMapNode url="~/Control/Modify.aspx" title="Modify"  description="Modify candidate info in The Family Tree" />
          <siteMapNode url="~/Control/Verify.aspx" title="Verify"  description="Verify candidate info in The Family Tree" />
        </siteMapNode>
    </siteMapNode>
</siteMap>
Any light you can shed on this is most appreciated.

Fred
Reply With Quote
  #2 (permalink)  
Old February 15th, 2012, 07:42 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Fred,

The good thing about the changes in the ASP.NET menu is that it;s no no longer an ASP.NET issue. You can now simply apply existing CSS techniques to the menu. For example, you can use the "Sucker fish" code to style the menu:

http://www.htmldog.com/articles/suckerfish/dropdowns/
http://www.alistapart.com/articles/dropdowns

Quote:
If I put the main menu bar horizontal on the bottom, which I have without a problem, is ther a way to make the submenu pop upward instead of down?
It can be done, but it requires some studying ;-)

http://www.pmob.co.uk/temp/dropup3.htm
http://www.google.com/?q=css+menu+upwards

Quote:
I can't seem to get the character color in the main or submenus to be what I want them to be. They come up purple and stay that way.
Maybe you also need to style the "visited" pseudo selector?

Quote:
I am able to set the main menu and hover background color as well as the submenu background colors, but that is all.
Not sure what the question is here.

Quote:
I am able to set the selected character color on main menu, however when I click on a submenu item the submenu item does change to the selected color, but the main menu option that holds the submenu options looses its character and background color.
Again, not sure what you're asking. Could this be due tp the unstyled ":visited" item?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Different items in WebSiteMap and Menu AlexW ASP.NET 4 General Discussion 6 April 11th, 2011 12:26 PM
Blank items in menu ricardor ASP.NET 2.0 Basics 2 December 18th, 2009 06:08 AM
CH 15 Context Menu - Element Menu Items Razzy The Pug BOOK: Ivor Horton's Beginning Visual C++ 2005 2 November 9th, 2008 03:53 PM
Adding Menu Items using VB SamuelP ASP.NET 2.0 Professional 0 October 23rd, 2006 08:01 AM
Menu Items JoBi C# 0 October 20th, 2004 08:51 PM



All times are GMT -4. The time now is 09:55 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.