Firing JavaScript from server
I've got a problem:
I've got a popup window.
On this window I've got a button called 'SEND' and a button called 'CANCEL'. 'SEND' is defined as runat="server" and it also has an onclick event. The button does two things:
1. On the server side it sends an email. 2. The onclick event does a javascript window.close(). The problem is, when the window.close() occurs, it prevents the email from actually getting sent.
What I'm trying to do to solve the problem is to remove the onclick event from SEND and instead, on the server side, after the email is sent, cause the 'CANCEL' button to be clicked, which closes the window. Or what would be easier and more direct would be to just ignore the cancel button and have the codebehind fire a javascript 'window.close()' event. Am I on the right track for a solution? Any other ideas? (Any ideas that work will do!)
Thanks,
cudabean