I've written a custom extender that extends any control that when you right click on the control, a context menu panel is brought up in which the content gets dynamically generated because it uses the DynamicPopulateBase.
The problem I'm having (IE/Firefox) is that the panel gets wider every time the pop up is shown.
Now, currently .. my webservice returns html anchors that I generate __doPostBack('__Page', .. ); for so I can cause actions to occur, but I want to stop using postbacks for this because I don't need them for most of the context menu actions. For the most part, the links that are generated should just be calls to some custom javascript which causes my modal popups to appear.
My previous technique was to use the postback to get the context panel to always appear the correct size .. but I should really fix it.
Here's the mouse click event handler that I use to populate and show the popup:
<script type="text/javascript" language="javascript">
this._onClick = function(e) {
var rightclick;
if (!e) var e = window.event;
if (e.which) rightclick = (e.which == 3);
else if (e.button) rightclick = (e.button == 2);
if (rightclick) {
if (!_isVisible) {
// Set X/Y?
_popupBehavior.set_x(e.offsetX + 5);
_popupBehavior.set_y(e.offsetY + 5);
_popupBehavior.show();
this.populate();
_isVisible = true;
} else {
// Set X/Y?
_popupBehavior.set_x(e.offsetX + 5);
_popupBehavior.set_y(e.offsetY + 5);
_popupBehavior.hide();
_popupBehavior.show();
this.populate();
}
window.event.returnValue = false;
} else {
_popupBehavior.hide();
_isVisible = false;
}
return false;
}
</script>Any suggestions?