I'm getting an AjaxControlToolkit exception when transitioning out of a page containing a user control that in turn contains a DragPanelExtender.
The exception occurs at ll. 1559 of MicrosoftAjax.debug.js (version 3.5.30729.196):
if (!this.isInstanceOfType(instance))
throw Error.argumentType('instance', Object.getType(instance), this);
where instance is an object (of type "object") bearing name="FloatingBehavior", and 'this' is an object of type "function" whose __typeName = "AjaxControlToolkit.FloatingBehavior". From what I can tell, it looks like the context is an attempt to dispose
of the FloatingBehavior.
I'd very much appreciate if anyone who's seen something like this before can provide a clue or two as to how to solve this (since I'm out of clues this morning 8-)).
TIA
Josh
"AJAX .NET 3.5" "Ajax Control Toolkit""AJAX .NET 3.5"
What my thought of the cause is you use the Popup drag function of the DragPanelExtender and miss the error catching script in the sample code. Please add this script into your page side code.
<script type="text/javascript">
// The following snippet works around a problem where FloatingBehavior
// doesn't allow drops outside the "content area" of the page - where "content
// area" is a little unusual for our sample web pages due to their use of CSS
// for layout.
function setBodyHeightToContentHeight() {
document.body.style.height = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight) + "px";
}
setBodyHeightToContentHeight();
$addHandler(window, "resize", setBodyHeightToContentHeight);
</script>
Best regards,
Zhi-Qiang Ni
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
Answer” if a marked post does not actually answer your question.
It turns out that the problem wasn't related to FloatingBehavior. The problem page was built with .NET 1.1 (yeah, quite a few years ago!), and in those days the black-magic code was in the same file as everything else; the OnInit and InitializeComponent
overrides probably overrode something important. Also, the original markup used just a <head> rather than <head runat="server"> element, and between those two things, the page lifecycle was skewed such that all the pageUnloads didn't happen until you physically
departed the page (or closed the application).
Rebuilding the page from scratch miraculously solved the problem.
None
0 Points
2 Posts
mysterious ACT exception thrown when departing page ..
Sep 11, 2009 11:17 AM|Josh Korn|LINK
I'm getting an AjaxControlToolkit exception when transitioning out of a page containing a user control that in turn contains a DragPanelExtender.
The exception occurs at ll. 1559 of MicrosoftAjax.debug.js (version 3.5.30729.196):
if (!this.isInstanceOfType(instance))
throw Error.argumentType('instance', Object.getType(instance), this);
where instance is an object (of type "object") bearing name="FloatingBehavior", and 'this' is an object of type "function" whose __typeName = "AjaxControlToolkit.FloatingBehavior". From what I can tell, it looks like the context is an attempt to dispose of the FloatingBehavior.
I'd very much appreciate if anyone who's seen something like this before can provide a clue or two as to how to solve this (since I'm out of clues this morning 8-)).
TIA
Josh
"AJAX .NET 3.5" "Ajax Control Toolkit" "AJAX .NET 3.5"
All-Star
27946 Points
2939 Posts
Re: mysterious ACT exception thrown when departing page ..
Sep 15, 2009 05:00 AM|Zhi-Qiang Ni - MSFT|LINK
Hi Josh,
What my thought of the cause is you use the Popup drag function of the DragPanelExtender and miss the error catching script in the sample code. Please add this script into your page side code.
<script type="text/javascript">
// The following snippet works around a problem where FloatingBehavior
// doesn't allow drops outside the "content area" of the page - where "content
// area" is a little unusual for our sample web pages due to their use of CSS
// for layout.
function setBodyHeightToContentHeight() {
document.body.style.height = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight) + "px";
}
setBodyHeightToContentHeight();
$addHandler(window, "resize", setBodyHeightToContentHeight);
</script>
Best regards,
Zhi-Qiang Ni
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
Answer” if a marked post does not actually answer your question.
None
0 Points
2 Posts
Re: mysterious ACT exception thrown when departing page ..
Sep 17, 2009 05:28 AM|Josh Korn|LINK
Thanks very much for your observations.
It turns out that the problem wasn't related to FloatingBehavior. The problem page was built with .NET 1.1 (yeah, quite a few years ago!), and in those days the black-magic code was in the same file as everything else; the OnInit and InitializeComponent overrides probably overrode something important. Also, the original markup used just a <head> rather than <head runat="server"> element, and between those two things, the page lifecycle was skewed such that all the pageUnloads didn't happen until you physically departed the page (or closed the application).
Rebuilding the page from scratch miraculously solved the problem.
Regards
Josh