clickable area in menu too small

Last post 04-04-2007 4:09 AM by benderm. 8 replies.

Sort Posts:

  • clickable area in menu too small

    01-25-2007, 10:55 AM
    • Loading...
    • recloose
    • Joined on 01-25-2007, 3:52 PM
    • Posts 4

    Is it possible to make the entire area of a menu item clickable in an asp.net menu control?

    Currently, only the text is clickable.

    Thx for your help!

  • Re: clickable area in menu too small

    02-06-2007, 2:22 AM
    • Loading...
    • GeorgeZ
    • Joined on 11-16-2006, 1:09 AM
    • UpC
    • Posts 552
    Anyone?
  • Re: clickable area in menu too small

    02-06-2007, 8:38 AM
    Answer
    • Loading...
    • fafar
    • Joined on 07-07-2005, 1:36 AM
    • Toronto, Canada
    • Posts 217

    Yes,

    define a css class for the menuitem like this (change width property to you desired value):

    .menuitem
    {
        width:100px;
        display: block;
    }

     and then assign this style class to the dynamicmenuitemstyle and staticmenuitemstyle cssclass property.

     

    Robert Kafarski,

    Aure Entuluva!
    - Day shall come again!
  • Re: clickable area in menu too small

    02-08-2007, 9:07 AM
    • Loading...
    • recloose
    • Joined on 01-25-2007, 3:52 PM
    • Posts 4

    Hi Fafar Robert,

    your information has been very usefull and correct!

    Thx a lot.

    Grtz,

    Recloose(Thomas)Cool!

  • Re: clickable area in menu too small

    02-16-2007, 8:47 PM
    • Loading...
    • rgrover
    • Joined on 01-23-2007, 11:02 PM
    • Posts 5

    I am having the same problem.  Adding the CSS attribute 'display: block' expanded the clickable area, but it also messed up the text.  I'm trying to create a menu where each node has a background image (a button).  When I add 'display: block', the text moves to the top of the button, while I want it in the middle.

     

    Any suggestions?

     

    CSS:

    *.menuItem
    {
        background-image: url(images/nav_buttons_blank.gif);
        background-repeat: no-repeat;
        height: 40px;
        width: 165px;
        text-align: center;
        color: White;
        font-family: Verdana, Arial;
        font-size: 14px;
        font-weight: bold;
        background-color: Transparent;
        display: block;
        vertical-align: middle;
    }

     .NET (VB):

    <asp:Menu ID="Menu1" runat="server" >
                <StaticMenuItemStyle CssClass="menuItem" />
                <Items>
                    <asp:MenuItem Text="Beverages" Value="Beverages"></asp:MenuItem>
                    <asp:MenuItem Text="Sandwiches" Value="Sandwiches"></asp:MenuItem>
                    <asp:MenuItem Text="Desserts" Value="Desserts"></asp:MenuItem>
                </Items>
            </asp:Menu>

     

    Thanks!
     

  • Re: clickable area in menu too small

    02-16-2007, 10:27 PM
    • Loading...
    • fafar
    • Joined on 07-07-2005, 1:36 AM
    • Toronto, Canada
    • Posts 217

    Hi,

    you can play with margin or padding attributes... have you tried that? (try to adjust px value)

    padding-top: 5px; /*this one does not affect the placement of the background picture */

    or

    margin-top: 5px; /*this one does*/

    Robert Kafarski,

    Aure Entuluva!
    - Day shall come again!
  • Re: clickable area in menu too small

    03-13-2007, 1:46 AM
    • Loading...
    • veeaar
    • Joined on 03-13-2007, 5:43 AM
    • Posts 2

    hi everyone,

    i have the similar problem of creating a menu.

    But i want to do it with C#.

    when i try to do:-

    <asp:Menu ID="Menu1" runat="server" >

    </asp:Menu>

    ---it says error creating control

    plz help.

    Filed under: , ,
  • Re: clickable area in menu too small

    03-29-2007, 1:49 PM
    • Loading...
    • blewis
    • Joined on 03-29-2007, 5:48 PM
    • Posts 1
    wow, that really didn't work at all.
  • Re: clickable area in menu too small

    04-04-2007, 4:09 AM
    • Loading...
    • benderm
    • Joined on 01-16-2007, 3:47 AM
    • Denver, CO
    • Posts 291

    This kind of worked for me, in IE everything is fine, but in firefox it only works for the first level of dynamic menu items.

    Can anyone help with a workaround?



    Don't forget to click "Mark as Answer" on the post that helped you.
    This marks your thread as Resolved so we will all know you have been helped.
Page 1 of 1 (9 items)
Microsoft Communities
Page view counter