OK. I know I can do this using the .add_close() method on the client-side event.
However, I need to add the function in such a way as to allow me to access objects from the calling functio9n in the callback function. So, I have something like this...
And this seems to work just fine.
Except.
The server-size code, invoked by my AjaxRequestJson() call is executed multiple times if the window is opened multiple times.
Now, if I were doing this in the more traditional way (with the callback function being a standalone function) I'd just call remove_close(functionname) in the callback function itself.
So, to the question: what do I pass to the remove_close() function to prevent multiple copies of the nested function from being called?
--
Stuart
However, I need to add the function in such a way as to allow me to access objects from the calling functio9n in the callback function. So, I have something like this...
function
ProcessToolTipAction(action, ID)
{
if
(action ==
"<%= GlobalConstants.CommandName.REQUESTINVITE %>"
)
{
var
wnd = $find(
'<%=winInviteSelf.ClientID %>'
);
wnd.add_close(
function
(sender, e)
{
var
args = e.get_argument();
if
(IsDialogResultOK(args))
{
AjaxRequestObject = GetAjaxRequestObject(action,
"<%=this.GetType().ToString()%>"
);
AjaxRequestObject.AppointmentId = ID;
AjaxRequestObject.HideInvite = args.HideInvite;
AjaxRequestObject.SpecialNotes = args.SpecialNotes;
AjaxRequestJson(AjaxRequestObject);
}
});
wnd.show();
}
}
Except.
The server-size code, invoked by my AjaxRequestJson() call is executed multiple times if the window is opened multiple times.
Now, if I were doing this in the more traditional way (with the callback function being a standalone function) I'd just call remove_close(functionname) in the callback function itself.
So, to the question: what do I pass to the remove_close() function to prevent multiple copies of the nested function from being called?
--
Stuart