Thursday, June 3, 2010

Why Does the Modal Popup Control of AJAX Control Toolkit Always Re-Positions Itself After You Move It?

There is a problem with the Modal Popup control in the AJAX .NET Control Toolkit. The fix is not documented very well.

When the popup is shown, you can drag it around in the browser window if you specified its "PopupDragHandleControlID" in your code. However, when you release your mouse button, the poup box moves back to its original position automatically, --with animation, too!

It turns out that in their example, they added a piece of javascript to fix just this problem. The function is called "setBodyHeightToContentHeight", and it is specifed as a window resize handler. Even though the window is not resized when you move your popup box in the browser window, this will fix your problem.

No comments:

Post a Comment