0

hoping someone can help me I think I know what the issue is but I can't seem to make it work.

I have a small website written with VB web developer 2010.

I am looking to move the host company I am using but the problem I am running into is that the buttons at the top of the page:

<asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal">
    <Items>
        <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/>
        <asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/>
    </Items>
</asp:Menu>

The old host they show up fine. New host (VPS server that I do everything myself) show up as only a hyperlink.

I think that it is the version of ASP.net I compile it with, currently 3.5, but I could be wrong, I have tried multiple times to get it to work.

Any help is appreciated. Thanks!

Andrea
  • 11,801
  • 17
  • 65
  • 72
Demonicpenguin
  • 113
  • 1
  • 3
  • 13

2 Answers2

3

Are you sure you copied over the CSS files that go along with the project, and that they are in a directory that has the correct permissions?

Read this link then: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.menu.renderingmode.aspx

In particular it references a rendermode setting that you may need to set when you are changing from 3.5 or lower to 4.0

The value of the RenderingMode property determines how the menu control renders markup for the Menu control. In ASP.NET 3.5 and earlier versions, the Menu control uses HTML table elements and inline styles to specify the appearance of the menu in a browser. In ASP.NET 4 and later versions, by default the Menu control uses HTML listitem elements and cascading style sheet (CSS) styles. If you do not set this property, the Menu control renders markup that is appropriate to the ASP.NET version that is indicated by the Control.RenderingCompatibility property. The Menu control uses the following rules:

  • If the value of the RenderingCompatibility property is 3.5, the Menu control uses HTML table elements and inline styles.
  • If the value of the RenderingCompatibility property is 4.0 or greater, the Menu control uses HTML listitem elements and CSS styles.

This property is provided for backward compatibility. If the RenderingCompatibility property indicates that you want controls to generate HTML that is compatible with ASP.NET 4 or later, but you want the Menu control to be an exception that uses earlier behavior, you can set this property to Table. For example, if you have a Web page that displays text from right to left you might want to set this property to Table because some browsers do not display the List mode markup properly for right-to-left text.

E.J. Brennan
  • 45,870
  • 7
  • 88
  • 116
  • Direct upload using FTP, the reason why I think that it is the server/version of asp.net, I was using godaddy and there was a setting for 4.0 and I believe that is where I am getting the issue, if I run the website using debugging on my PC it shows hyperlinks aswell, the only place that it has shown up as buttons is godaddy – Demonicpenguin Sep 22 '13 at 01:16
  • 1
    Edited my response, still ultimately is a CSS issue I believe, but the setting may direct it to use the right CSS. – E.J. Brennan Sep 22 '13 at 01:21
0

Solution!

Server side: change the asp.net version to 4.0 using the answer located here

In your Web.config

I had a line with this

<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>

Change to

<pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID"/>

Complete!

Thank you for your help E.J. without knowing it was CSS related I could not have come across the answer.

Community
  • 1
  • 1
Demonicpenguin
  • 113
  • 1
  • 3
  • 13