I believe that the problem lies in that the popup control does not take into account a scroll offset. I agree with some of the comments that this library needs some work, but that is why we are here on the bleeding edge...to help make it better.
Here is what I did to fix:
1. Add this function to AjaxControlToolkit\Common\Common.js (I added it after getClientBounds)
getClientScrollOffset : function() {
/// <summary>
/// Gets how much the page has scrolled.
/// </summary>
/// <returns type="Array">
/// Scrolled x and y values for the browser window.
/// </returns>
var x,y;
if (window['pageYOffset'] != undefined) // all except Explorer
{
x = window.pageXOffset;
y = window.pageYOffset;
}
else if (document.documentElement && document.documentElement['scrollTop'] != undefined)
// Explorer 6 Strict
{
x = document.documentElement.scrollLeft;
y = document.documentElement.scrollTop;
}
else if (document.body) // all other Explorers
{
x = document.body.scrollLeft;
y = document.body.scrollTop;
}
return [x, y];
},
2. Modify a section of the show function in AjaxControlToolkit\PopupControl\PopupControlBehavior.js (specifically, I added the "var scrollOffsetX"... line and modified the "if (newPosition.x + newPosition.width"... section)
...
var documentWidth = self.innerWidth ? self.innerWidth : document.documentElement.clientWidth;
var scrollOffsetX = CommonToolkitScripts.getClientScrollOffset()[0];
// CONSIDER: Create a generic function to return this information.
if (!documentWidth) {
documentWidth = document.body.clientWidth;
}
if (newPosition.x + newPosition.width > (documentWidth + scrollOffsetX - 5)) {
position.x -= newPosition.x + newPosition.width - documentWidth - scrollOffsetX + 5;
updateNeeded = true;
}
if (newPosition.x < 0) {
position.x -= newPosition.x;
updateNeeded = true;
}
if (newPosition.y < 0) {
position.y -= newPosition.y;
updateNeeded = true;
}
...
This seems to work for me, but please provide feedback.