Solved

asp menu need to change hyperlink size

Posted on 2011-02-18
6
491 Views
Last Modified: 2012-05-11
i have a static/dynamic asp.net menu working which is mapped to a sitemapprovider. it works fine - the problem that i now have is the customer wants the menu (which are all hyperlinks to be a different size than all the other hyperlinks on the site.) All of the link tags are in the CSS file...

here is the element definition - i have tried changing the sizes for both dynamic and static  - but they are being overridden by the CSS... how / where do i put the size change in THE URL link?
 <asp:Menu ID="MastHeadMenu" runat="server" BackColor="#3379AE"
                                                    DataSourceID="SiteMapDataSource1" DynamicHorizontalOffset="2"
                                                    Font-Bold="True" ForeColor="White"
                                                    MaximumDynamicDisplayLevels="2" Orientation="Horizontal"
                                                    StaticEnableDefaultPopOutImage="False"
                                                    Width="800px" DynamicMenuItemStyle-ItemSpacing="2px"
                                                    StaticSubMenuIndent="24px" >
                                                    <StaticMenuItemStyle HorizontalPadding="5px"  
                                                        VerticalPadding="0px" Width="180px" />
                                                    <DynamicMenuStyle BackColor="#006699" />
                                                    <DynamicMenuItemStyle VerticalPadding="1px"  HorizontalPadding="5px"   />
                                                </asp:Menu>
0
Comment
Question by:quigleyryan
  • 3
  • 2
6 Comments
 
LVL 12

Expert Comment

by:HugoHiasl
ID: 34929778
Set a CssClass and define it there.
0
 
LVL 6

Expert Comment

by:t-max
ID: 34929859
You can put the "style" property in the <a> tag, like mentioned here: http://msdn.microsoft.com/en-us/library/h4kete56.aspx
0
 

Author Comment

by:quigleyryan
ID: 34929873
even if i set up the menu with a CSSClass - it still gets overridden by the a:link in the css...
so i need to put the font tag in the <a href> area, but don't know where that is - in the asp menu definition
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 6

Expert Comment

by:t-max
ID: 34929874
0
 

Author Comment

by:quigleyryan
ID: 34929901
t-max -- yes this is what i need to do, but where is the <a> tag in the asp.net menu... see code above.. the provider has
    Public Overrides Function BuildSiteMap() As SiteMapNode
        ' Only allow the Site Map to be created by a single thread
        SyncLock Me
            ' Attempt to get Root Node from Cache
            Dim context As HttpContext = HttpContext.Current
            _rootNode = CType(context.Cache("RootNode"), SiteMapNode)

            If _rootNode Is Nothing Then
                HttpContext.Current.Trace.Warn("Loading from database")

                ' Clear current Site Map
                Clear()

                ' Load the database data
                Dim tblSiteMap As DataTable = GetSiteMapFromDB()

                ' Get the root node
                _rootNode = GetRootNode(tblSiteMap)
                AddNode(_rootNode)

                ' Build the child nodes
                BuildSiteMapRecurse(tblSiteMap, _rootNode)
0
 
LVL 6

Accepted Solution

by:
t-max earned 500 total points
ID: 34929953
I think you need the MenuItemStyle tag. Take a look to the example and properties here: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.menuitemstyle.aspx
Won't be able to help more now, but I hope this helps you. Good luck!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Class object 2 26
Getting Column Height to Match Other Column 5 44
Turn on intranet settings 1 36
Problem with a CSS in a page 2 25
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

919 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now