3

I am currently testing a menu in ASP.NET I've recently made using asp:menu control.

The menu is just as I want it to be right now, but whenever there is a postback that updates the whole page, it moves a little downwards (only once, a second postback won't move it a little bit more).

  • It's not CSS - > I've removed all CSS from this menu)
  • It's not any property -> I've commented out everything related to customizing the menu
  • It's not any other element above it enlarging -> I've specially put it inside a table, in which the only content is the asp:menu control

    It moves a lot downwards in IE6, a little in IE8, and it doesn't move at all in Firefox 4.

    What could I do ? Are there any alternatives ? Is there any property I can use, or any outer element I could put it inside in order for it to stay still ?

    And yes, every single machine this is going to run in is using Internet Explorer. The nightmare of any web developer.

    ---[update]-----
    I've built a menu in a separate project, and the effect wasn't there! I've copied the exact same files into my project, and ran it, and the issue was there.

    Could it be a difference in the asp.net version ?

  • Marcelo
    • 3,371
    • 10
    • 45
    • 76
    • Please show some code. It is hard to help with just your description. – Josh Mein Jun 10 '11 at 19:22
    • I'm assuming that when the menu moves down it is pushed down by white space. If this is the case then right-click > inspect the element and find out what is pushing your content down. – BentOnCoding Jun 10 '11 at 19:23
    • Post Html for that element along it's parent, without that it is not possible to predict anything. – Usman Masood Jun 10 '11 at 19:32
    • I tested your markup included above with a completely new blank website in VS 2010 and Framework 4.0. I cannot reproduce your problem in IE7, Chrome, or Firefox. Unfortunately I don't have IE6 or IE8 readily available. Did you try your markup above in a new blank website project? – pseudocoder Jun 10 '11 at 20:27
    • @Marcello Does the above code still cause a problem in those browsers when you isolate it to a blank web form that contains only this? – Brian Webster Jun 11 '11 at 01:30
    • @pseudocoder: for testing in all versions of IE I use [IETester](http://www.my-debugbar.com/wiki/IETester/HomePage) - you've probably already heard if it, but I thought I'd share just in case. – Tr1stan Jun 13 '11 at 12:40

    3 Answers3

    0

    I had the same problem. My navigation menu sits in an UpdatePanel, and I changed the UpdateMode from Always to Conditional - problem solved. This was in my master page.

    0

    Did you check using IE web developer toolbar to see what's the html looks like in that area before and after the postback? It seems more like a browser issue so the toolbar would give you details as what is coming in the gap or may be what's pushing it down.

    Pronay Sharma
    • 98
    • 1
    • 1
    • 6
    • Thanks for that! This has made things more interesting as well as more confuse. Check it out: http://i.stack.imgur.com/tLP4G.jpg . No idea what this #text might be.. It doesn't display any properties when clicked. – Marcelo Jun 13 '11 at 14:17
    • That #text is coming because there is an white-space character in your aspx after the href. The ENTER key you hit after the href for indentation also intrduces the white-space character. Remove that and check again if it works... – Pronay Sharma Jun 14 '11 at 07:50
    • It's not that.. I've even tested it with one single item in the menu, with no navigation, only one property set (text), and no indentation or formatting issues.. – Marcelo Jun 14 '11 at 12:59
    0

    If the app is in asp.net 4.0, look at the source code of the page after it renders the first time, and then after the postback. Make sure it renders as divs on both or tables on both.

    I currently have a similar issue where my menu "spreads out" on the postback. Before the postback, it renders divs. After the postback, it renders tables.

    There is specifically a property on the menu "RenderingMode" which is suppose to control this, but it is not working for me.

    caesay
    • 16,932
    • 15
    • 95
    • 160