Error: 'top.document.documentElement' is null or not an object RRS feed

  • Question

  • User-1025212333 posted

    I try to add Asp.net Ajax to a web site, but when I add a ScriptManager to a page
    I get the error

    Error: 'top.document.documentElement' is null or not an object

    whenever I click on a control in that page
    (e.g. a TextBox)

    Any ideas of what I might have missed?
    Tuesday, January 30, 2007 3:59 AM

All replies

  • User-1351460941 posted


    I have the same problem and I don't understand what is the error. I have the ScriptManager in the MasterPage file and the rest of the pages are working correctly.

     Any idea?

    Friday, February 2, 2007 7:31 PM
  • User344644133 posted

    Anyone figure this out?  I'm having the same problem and it started right after upgrading to the release version.  We have a page hosted inside of an iframe that throws the errors, so I'm wondering if it's related to that somehow?

    Appreciate any help anyone has on this.

    Friday, February 9, 2007 2:28 AM
  • User-396192383 posted
    this page in the frame is one outside the immediate domain?  Do a search on iframe for the last two weeks or so there was several posts on this ....there is also a fix link posted for it - i do not have the link handy but it is in previous posts...
    Friday, February 9, 2007 4:38 AM
  • User1412848085 posted

    For any other person who cannot find the elusive 'iframe' reference that has the miracle answer heres my solution. When I loaded the page it was being loaded in an iframe. Because the iframe is now the parent, it is also considered the top. Try using the parent function to reference the immediate parent. I.E. 'parent.document.documentelement'.

    I hope that keeps the next person from wanting to beat people who leave references like "oh yeah I saw that here somewhere, it has something to do with..." as an answer to a question.

    Thursday, March 15, 2007 11:39 PM
  • User-193218584 posted

    Im using scriptmanger in asp.net and using the update panel to hold the contents to avoid postback of the page in gridview . Im getting the error top.document.documentElement is null or not an object. Plzz helpme cause i want to know whre can i make changes in ajax or make any addn to avoid getting this error .

    Thursday, September 13, 2007 11:56 PM
  • User2145199974 posted

    I've been having this same issue and I finally tracked it down.  I have several other javascript files in my project, one in particular tracks the mouse position for a floating div.  I  have several top/module level variables, two in particular are top & left.  They are the root of the problem and they interfer with the MicrosoftAjax.js file that is being served up by ScriptResource.axd.

    Long story short, change your variable names from top and left, to something else like m_top, m_left (and don't forget to change it everywhere in your code).  Variable naming just got a whole lot trickier now that we need to worry about outside scripts and not just our own.

    Tuesday, October 23, 2007 7:39 PM
  • User-1326332835 posted

    Thanks a lot Blue Lava it solved my problem.. gr8

    Wednesday, June 22, 2011 7:30 AM