Showing posts with label document. Show all posts
Showing posts with label document. Show all posts

Monday, March 26, 2012

Explaining the structure of Rating/Accordian Control

Are there any documentation or could anyonoe take the time to explain/document, or a step by step run through of creating controls similar to these two? Where the extender is 'dynamically' attached to a server control in the code?

Thanks and Regards.

Hi Inventisity,

Accordion,NoBot,Rating, andReorderList are all examples of controls that wrap extenders. This pattern is useful in situations where the extender requires the markup of the target control to be in a specific (and possibly lengthy) format. You write the server-side extender and client-side behavior as usual. You then create a control (by inheriting from something likeWebControl orPanel) that renders the appropriately formatted markup, dynamically create your extender/properties, and point yourproperties.TargetControlID atthis.ID (and hence the rendered markup). Following common practices for writing server controls, the extender and its properties are created in theCreateChildControls method (which we make sure is called before anywhere we access the extender/properties usingEnsureChildControls). Finally, the necessary properties are exposed on the control (and just passed off to the actual properties object).

I think this should give you an idea of what these controls are doing, but please post back if you have any other unanswered questions. If you plan on writing your own control that wraps extenders, keep an eye onwork item #1687 because it applies to all of these controls.

Thanks,
Ted

Wednesday, March 21, 2012

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

Hello,

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?

Hello,

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?


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.


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...

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.


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 .


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.