Localhost displaying differently in IE8

Last post 07-08-2009 4:02 AM by withnail. 3 replies.

Sort Posts:

  • Localhost displaying differently in IE8

    07-07-2009, 6:45 PM
    • Member
      1 point Member
    • withnail
    • Member since 07-07-2009, 6:24 PM
    • Posts 2

    I have spent the last day reformatting pages as they were not displaying as intended in IE8 (mainly issues with centering and changing to margin: 0 auto 0 auto; for divs/tables).

    Once finished, before putting the new aspx pages onto our test servers, I was doing another quick bug fix and noticed that the pages were actually displayed with the correct formatting (as set up for IE6/IE7) on our test servers.

    After seeing this I then went back to my locally hosted files and noticed that when calling the localhost/127.0.0.1 the pages displayed incorrectly, but when I used my local server name/ip address the pages were formatted as intended. e.g.

    //localhost/mainpage.aspx - page format incorrect

    //withnail/mainpage.aspx - page formatted correctly

    Just wondering if there is a explanation for this, or a work around to get the page displaying correctly no matter how it is called? (Would be nice to know the reason why, rather than just ignore it)

  • Re: Localhost displaying differently in IE8

    07-07-2009, 11:16 PM
    Answer
    • All-Star
      33,913 point All-Star
    • vcsjones
    • Member since 04-18-2006, 8:53 PM
    • Falls Church, VA
    • Posts 4,331
    • Moderator
      TrustedFriends-MVPs

    This might be because of "compatibility" mode. IE may enable compatibility mode if it thinks the page needs it. So, it might be turning off compatibility on for http://localhost, but turning it on for http://mytestserver. Check and see if it is enabled. It's the picture of the torn document next to the address bar.

    Cheers,
           Kevin Jones


  • Re: Localhost displaying differently in IE8

    07-08-2009, 12:42 AM
    • All-Star
      20,632 point All-Star
    • venkatu2005
    • Member since 07-01-2008, 6:48 AM
    • Posts 4,514

    withnail:
    Just wondering if there is a explanation for this, or a work around to get the page displaying correctly no matter how it is called? (Would be nice to know the reason why, rather than just ignore it)

    This is because Browser Compatible issue.  so you have to check it on both browser. Try to apply all the styles on CSS.


    I have Changed My Blog from (http://venkat-dotnetsamples.blogspot.com) to (http://venkat-dotnetsnippets.blogspot.com)

    Regards,
    Venkatesan.M

    Please Mark as Answered If its helpful and Un-Mark as Answered if it not help u.
  • Re: Localhost displaying differently in IE8

    07-08-2009, 4:02 AM
    • Member
      1 point Member
    • withnail
    • Member since 07-07-2009, 6:24 PM
    • Posts 2

    vcsjones, you've nailed it.

    When compatibility view is enabled or set to "Display all websites in compatibility view" rather than just intranet sites, the page is rendered as it would on IE6/7.

    Cheers for the help.

Page 1 of 1 (4 items)