Trying to add spaces to my menu item (using Menu Control and StaticItemFormatString)

Last post 07-03-2009 6:11 AM by jfeeney. 3 replies.

Sort Posts:

  • Trying to add spaces to my menu item (using Menu Control and StaticItemFormatString)

    07-02-2009, 9:49 PM
    • Member
      37 point Member
    • jfeeney
    • Member since 04-07-2008, 8:16 AM
    • Posts 311

     Looking to see how to add spaces to the items on my menu. I found some discussion StaticItemFormatString. I copied an example and it does put spaces between my items. Since I had already played with ImageSeparator, I might want to leave them.

    The problem is that the spaces are only showing up ahead of each menu item. So with the separator image there I look like this:

      Home|   Prouducts|   Projects|

    I would like to look like this

    Home | Product | Projects |

    Is there a way that the StaticitemFormatString (or other more appropreiate method) can put a space on both sides of my menu item?

    Here is my menu control code

    <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" 
                    BackColor="#535353" Font-Size="X-Large" ForeColor="#FFCC00"
                     StaticItemFormatString="&nbsp &nbsp{0}" >
                    <Items>
                        <asp:MenuItem Text="Home" Value="Home" NavigateUrl="~/PhotoGallery.aspx" 
                            SeparatorImageUrl="~/Images/Menu_Separator.jpg"></asp:MenuItem>
                        <asp:MenuItem Text="Products" Value="Products" NavigateUrl="~/Products.aspx" 
                            SeparatorImageUrl="~/Images/Menu_Separator.jpg"></asp:MenuItem>
                        <asp:MenuItem NavigateUrl="~/Projects.aspx" Text="Projects" Value="Projects" 
                            SeparatorImageUrl="~/Images/Menu_Separator.jpg">
                        </asp:MenuItem>
                        <asp:MenuItem NavigateUrl="~/WebDesign.aspx" Text="Web Design" 
                            Value="Web Design" SeparatorImageUrl="~/Images/Menu_Separator.jpg"></asp:MenuItem>
                        <asp:MenuItem NavigateUrl="~/Outsourcing.aspx" Text="Outsourcing" 
                            Value="Outsourcing" SeparatorImageUrl="~/Images/Menu_Separator.jpg"></asp:MenuItem>
                        <asp:MenuItem NavigateUrl="~/Photos.aspx" Text="Photos" Value="Photos" 
                            SeparatorImageUrl="~/Images/Menu_Separator.jpg">
                        </asp:MenuItem>
                        <asp:MenuItem Text="Photo Gallery" Value="Photo Gallery" 
                            NavigateUrl="~/PhotoGallery.aspx" 
                            SeparatorImageUrl="~/Images/Menu_Separator.jpg"></asp:MenuItem>
                        <asp:MenuItem NavigateUrl="~/Contact.aspx" Text="Contact" Value="Contact" 
                            SeparatorImageUrl="~/Images/Menu_Separator.jpg">
                        </asp:MenuItem>
                        <asp:MenuItem Text="Web Management" Value="Web Management" 
                            NavigateUrl="~/WebManagement/UBO_CMS.aspx"></asp:MenuItem>
                    </Items>
                </asp:Menu>


     

  • Re: Trying to add spaces to my menu item (using Menu Control and StaticItemFormatString)

    07-02-2009, 11:42 PM
    Answer
    • Member
      124 point Member
    • Usha82
    • Member since 06-17-2009, 12:24 PM
    • Posts 19

    Please change StaticItemFormatString as  StaticItemFormatString="&nbsp; {0} &nbsp;"

  • Re: Trying to add spaces to my menu item (using Menu Control and StaticItemFormatString)

    07-03-2009, 12:10 AM
    • Member
      21 point Member
    • toakhtar
    • Member since 08-19-2008, 3:23 PM
    • Pakistan
    • Posts 30

    your menu item text should be like Web&nbsp;Design

     asp:MenuItem NavigateUrl="~/WebDesign.aspx" Text="Web&nbsp;Design"    

  •                         Value="Web Design" SeparatorImageUrl="~/Images/Menu_Separator.jpg"></asp:MenuItem>
  • Mark as Answer if this reply helps you

    Muhammad Akhtar
    Software Engineer
    Microsoft Certified Technology Specialist(ASP.Net 2.0)
    toakhtar@hotmail.com
    bcs620_akhtar@yahoo.com
  • Re: Trying to add spaces to my menu item (using Menu Control and StaticItemFormatString)

    07-03-2009, 6:11 AM
    • Member
      37 point Member
    • jfeeney
    • Member since 04-07-2008, 8:16 AM
    • Posts 311

    Usha82:
    StaticItemFormatString="&nbsp; {0} &nbsp;"
     

    Now that I have seen your answer, I also have a clearer understanding of how the StaticFormatString works...Thanks

Page 1 of 1 (4 items)