void Close(string result)
{
if(_proxyForCurrentPopup == null) {
// Normal call - Simply register the relevant data item for the TargetControl
ScriptManager.GetCurrent(Page).RegisterDataItem(TargetControl, result);
} else {
// Proxy call - Add a LiteralControl to pass the information down to the interested PopupControlExtender
var literalControl = new LiteralControl();
literalControl.ID = "_PopupControl_Proxy_ID_";
_proxyForCurrentPopup.Controls.Add(literalControl);
ScriptManager.GetCurrent(_proxyForCurrentPopup).RegisterDataItem(literalControl, result);
}
}