I have an application that shows a list of items.
The user can click on an item and see its details in a modal popup (centered DIV, shown using JavaScript). I need t
To render the popup contents with a different style (e.g. not centered, 100% width) I dynamically update the position of the _foregroundElement (the PopupControlID) and _backgroundElement (created by the popup extender) on print.
var basePrint = window.print;
window.print = function() {
var popup = $find( '<%= [PopupExtenderID].ClientID %>' );
popup._backgroundElement.style.position = 'static';
popup._foregroundElement.style.position = 'static';
popup._layout();
basePrint();
// Restore settings for display
popup._backgroundElement.style.position = 'fixed';
popup._foregroundElement.style.position = 'fixed';
popup._layout();
}
Note: Won't work with browser's print button.